diff --git a/shiftregister/app/forms.py b/shiftregister/app/forms.py index d349f06..3b9b0a1 100644 --- a/shiftregister/app/forms.py +++ b/shiftregister/app/forms.py @@ -29,7 +29,7 @@ class RegisterForm(forms.Form): phone = PhoneNumberField( max_length=Helper.phone.field.max_length, label="Handynummer für Benachrichtigungen", - help_text="Wir nutzen deine Handynummer, um dir Benachrichtigungen zu deinen Schichten zu schicken. Wir löschen alle Daten 7 Tage nach dem Festival.", + help_text="Wir nutzen deine Handynummer, um dir Benachrichtigungen zu Schichten zu schicken. Wir löschen deine Daten 7 Tage nach dem Festival.", widget=text_input(), validators=[ validate_international_phonenumber, diff --git a/shiftregister/app/tasks.py b/shiftregister/app/tasks.py index cc7e88a..7ba4bd8 100644 --- a/shiftregister/app/tasks.py +++ b/shiftregister/app/tasks.py @@ -8,13 +8,19 @@ from .sipgate.sms import send as send_sms global_preferences = global_preferences_registry.manager() + def send(msg): - if not (settings.SIPGATE_SMS_EXTENSION and settings.SIPGATE_TOKEN and settings.SIPGATE_TOKEN_ID): + if not ( + settings.SIPGATE_SMS_EXTENSION + and settings.SIPGATE_TOKEN + and settings.SIPGATE_TOKEN_ID + ): print(f"would send message to {msg.to.phone}\n---\n{msg.text}") return send_sms(msg.to.phone, msg.text) + # cron task to send normal messages(reminders,changes) in batches @shared_task def send_messages(): diff --git a/shiftregister/settings.py b/shiftregister/settings.py index 5db64fd..6de9f54 100644 --- a/shiftregister/settings.py +++ b/shiftregister/settings.py @@ -65,6 +65,8 @@ MIDDLEWARE = [ ROOT_URLCONF = "shiftregister.urls" +LOGIN_URL = "/admin/login/" + TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", diff --git a/shiftregister/team/views.py b/shiftregister/team/views.py index c218969..aad3907 100644 --- a/shiftregister/team/views.py +++ b/shiftregister/team/views.py @@ -14,7 +14,7 @@ def index(request): pass -@login_required(login_url="/admin/login/") +@login_required def shift_overview(request): context = {} context["running_shifts"] = [ @@ -44,7 +44,7 @@ def add_helper_shift(self): pass -@login_required(login_url="/admin/login/") +@login_required def shift_detail(request, pk): shift = get_object_or_404(Shift, pk=pk) form = HelperShift() @@ -75,13 +75,11 @@ def shift_detail(request, pk): class HelperDetail(LoginRequiredMixin, DetailView): - login_url = "/admin/login/" template_name = "helper_detail.html" model = Helper class ShiftList(LoginRequiredMixin, ListView): - login_url = "/admin/login/" template_name = "shift_list.html" model = Shift title = "Alle Schichten"