From 3f106ecd1bd7620a6a46028791f287b3630d47e9 Mon Sep 17 00:00:00 2001 From: Sayyid Hamid Mahdavi Date: Mon, 14 Sep 2020 16:44:08 +0430 Subject: [PATCH] just for test --- apps/users/models.py | 13 +++++++------ utils/service_client.py | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/users/models.py b/apps/users/models.py index 2473397..925c0ae 100644 --- a/apps/users/models.py +++ b/apps/users/models.py @@ -169,12 +169,13 @@ class User(AbstractUser): self.notify(body=str(self.otp), title='OTP ') def notify(self, body, title= None, notification_type='sms'): - print(service_client.notification.submit_notification(phone_number=self.phone_number, - title=title, - body=body, - user_uuid=self.uuid, - notification_type=1, - )) + if settings.DEBUG: + print(service_client.notification.submit_notification(phone_number=self.phone_number, + title=title, + body=body, + user_uuid=self.uuid, + notification_type=1, + )) def __str__(self): diff --git a/utils/service_client.py b/utils/service_client.py index 1a8c718..794800c 100644 --- a/utils/service_client.py +++ b/utils/service_client.py @@ -7,4 +7,4 @@ service_client = Client( client_secret=settings.CLIENT_SECRET, grant_type=AccountsClient.GRANT_CLIENT_CREDENTIALS ) -service_client.login(scopes=['notification.notification:submit']) +# service_client.login(scopes=['notification.notification:submit'])