From f5adc0064e97e511fb9abc546aecaa4404bcb45f Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 29 Apr 2022 02:36:32 +0200 Subject: [PATCH] Convert phone number to string and fix typos --- shiftregister/app/models.py | 3 +-- shiftregister/app/tasks.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/shiftregister/app/models.py b/shiftregister/app/models.py index c2eb1fb..eeab6a3 100644 --- a/shiftregister/app/models.py +++ b/shiftregister/app/models.py @@ -118,8 +118,7 @@ class LoginToken(models.Model): send_count = models.IntegerField(default=0) def send(self): - text = f"Dein Registrierungslink zum Helfer*inensystem: https://kontakt.rocks/{self.get_absolute_url()} \nWenn du dich nicht registiert hast, ignoriere diese SMS." - print("msglen", len(text)) + text = f"Dein Registrierungslink zum Helfer*innensystem: https://kontakt.rocks{self.get_absolute_url()}\nWenn du dich nicht registriert hast, ignoriere diese SMS." msg = Message(to=self.helper, text=text) msg.save() self.sent_at = timezone.now() diff --git a/shiftregister/app/tasks.py b/shiftregister/app/tasks.py index 7ba4bd8..275196f 100644 --- a/shiftregister/app/tasks.py +++ b/shiftregister/app/tasks.py @@ -18,7 +18,7 @@ def send(msg): print(f"would send message to {msg.to.phone}\n---\n{msg.text}") return - send_sms(msg.to.phone, msg.text) + send_sms(str(msg.to.phone), msg.text) # cron task to send normal messages(reminders,changes) in batches