mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-25 00:33:41 -04:00
notify-admin-931
This commit is contained in:
@@ -190,7 +190,7 @@ class User(db.Model):
|
|||||||
return retval
|
return retval
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
return {
|
x = {
|
||||||
"id": self.id,
|
"id": self.id,
|
||||||
"name": self.name,
|
"name": self.name,
|
||||||
"email_address": self.email_address,
|
"email_address": self.email_address,
|
||||||
@@ -211,7 +211,10 @@ class User(db.Model):
|
|||||||
"services": [x.id for x in self.services if x.active],
|
"services": [x.id for x in self.services if x.active],
|
||||||
"can_use_webauthn": self.can_use_webauthn,
|
"can_use_webauthn": self.can_use_webauthn,
|
||||||
"state": self.state,
|
"state": self.state,
|
||||||
|
"preferred_timezone": self.preferred_timezone,
|
||||||
}
|
}
|
||||||
|
print(f"X = {x}")
|
||||||
|
return x
|
||||||
|
|
||||||
def serialize_for_users_list(self):
|
def serialize_for_users_list(self):
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ def update_user_attribute(user_id):
|
|||||||
recipient = user_to_update.mobile_number
|
recipient = user_to_update.mobile_number
|
||||||
reply_to = get_sms_reply_to_for_notify_service(recipient, template)
|
reply_to = get_sms_reply_to_for_notify_service(recipient, template)
|
||||||
else:
|
else:
|
||||||
|
print(f"REST1 returns {user_to_update.serialize()}")
|
||||||
return jsonify(data=user_to_update.serialize()), 200
|
return jsonify(data=user_to_update.serialize()), 200
|
||||||
service = Service.query.get(current_app.config["NOTIFY_SERVICE_ID"])
|
service = Service.query.get(current_app.config["NOTIFY_SERVICE_ID"])
|
||||||
|
|
||||||
@@ -137,6 +138,8 @@ def update_user_attribute(user_id):
|
|||||||
)
|
)
|
||||||
|
|
||||||
send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY)
|
send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY)
|
||||||
|
|
||||||
|
print(f"REST2 returns {user_to_update.serialize()}")
|
||||||
return jsonify(data=user_to_update.serialize()), 200
|
return jsonify(data=user_to_update.serialize()), 200
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user