From eea6933712e0b21ba0c14570c6de32e5b6523e6c Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 4 Dec 2023 14:53:29 -0800 Subject: [PATCH 1/2] notify-admin-931 --- app/models.py | 5 ++++- app/user/rest.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index d141d8c29..a95b5da02 100644 --- a/app/models.py +++ b/app/models.py @@ -190,7 +190,7 @@ def get_permissions(self, service_id=None): return retval def serialize(self): - return { + x = { "id": self.id, "name": self.name, "email_address": self.email_address, @@ -211,7 +211,10 @@ def serialize(self): "services": [x.id for x in self.services if x.active], "can_use_webauthn": self.can_use_webauthn, "state": self.state, + "preferred_timezone": self.preferred_timezone, } + print(f"X = {x}") + return x def serialize_for_users_list(self): return { diff --git a/app/user/rest.py b/app/user/rest.py index f49f78c57..65c0d4ebe 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -117,6 +117,7 @@ def update_user_attribute(user_id): recipient = user_to_update.mobile_number reply_to = get_sms_reply_to_for_notify_service(recipient, template) else: + print(f"REST1 returns {user_to_update.serialize()}") return jsonify(data=user_to_update.serialize()), 200 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) + + print(f"REST2 returns {user_to_update.serialize()}") return jsonify(data=user_to_update.serialize()), 200 From 3209c6d7239fc5045bab27964e229956b4c2f1b9 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 5 Dec 2023 07:29:18 -0800 Subject: [PATCH 2/2] remove print statements --- app/models.py | 4 +--- app/user/rest.py | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/models.py b/app/models.py index a95b5da02..ae2a2d552 100644 --- a/app/models.py +++ b/app/models.py @@ -190,7 +190,7 @@ def get_permissions(self, service_id=None): return retval def serialize(self): - x = { + return { "id": self.id, "name": self.name, "email_address": self.email_address, @@ -213,8 +213,6 @@ def serialize(self): "state": self.state, "preferred_timezone": self.preferred_timezone, } - print(f"X = {x}") - return x def serialize_for_users_list(self): return { diff --git a/app/user/rest.py b/app/user/rest.py index 65c0d4ebe..25714d94a 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -117,7 +117,6 @@ def update_user_attribute(user_id): recipient = user_to_update.mobile_number reply_to = get_sms_reply_to_for_notify_service(recipient, template) else: - print(f"REST1 returns {user_to_update.serialize()}") return jsonify(data=user_to_update.serialize()), 200 service = Service.query.get(current_app.config["NOTIFY_SERVICE_ID"]) @@ -139,7 +138,6 @@ def update_user_attribute(user_id): 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