Skip to content
Snippets Groups Projects
Commit 88b8a416 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

don't allow for empty NEXMO_FROM

parent b959851d
No related branches found
No related tags found
1 merge request!301Error logging
Pipeline #36788 passed
smasch (1.0.0~beta.3-1) unstable; urgency=low
* bug fix: upgrade from 0.15 version containing subjects failed
* bug fix: language import was not allowed
* bug fix: empty NEXMO_DEFAULT_FROM did not allow to send authentication
tokens using NEXMO (#364)
-- Piotr Gawron <piotr.gawron@uni.lu> Tue, 12 Jan 2021 10:00:00 +0200
......
......@@ -66,6 +66,8 @@ def configuration_items(apps, schema_editor):
create_item(apps, NEXMO_API_SECRET, nexmo_api_secret, "NEXMO API SECRET")
nexmo_api_from = getattr(settings, 'NEXMO_DEFAULT_FROM', '')
if nexmo_api_from is None or nexmo_api_from == "":
nexmo_api_from = "SMASCH"
create_item(apps, NEXMO_DEFAULT_FROM, nexmo_api_from, "The sender of the message from NEXMO (phone number or text)")
background_image = getattr(settings, "LOGIN_PAGE_BACKGROUND_IMAGE", "background.jpg")
......
......@@ -32,6 +32,8 @@ class Nexmo:
api_secret = ConfigurationItem.objects.get(type=NEXMO_API_SECRET).value
self.client = nexmo.Client(key=api_key, secret=api_secret)
self.default_from = ConfigurationItem.objects.get(type=NEXMO_DEFAULT_FROM).value
if self.default_from is None or self.default_from == "":
self.default_from = "SMASCH"
def send_sms(self, device, token):
body = 'Your authentication token is %s' % token
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment