diff --git a/areas/__pycache__/__init__.cpython-38.pyc b/areas/__pycache__/__init__.cpython-38.pyc index 3fed716..3ff9165 100644 Binary files a/areas/__pycache__/__init__.cpython-38.pyc and b/areas/__pycache__/__init__.cpython-38.pyc differ diff --git a/areas/__pycache__/admin.cpython-38.pyc b/areas/__pycache__/admin.cpython-38.pyc index f4e758a..c67ec55 100644 Binary files a/areas/__pycache__/admin.cpython-38.pyc and b/areas/__pycache__/admin.cpython-38.pyc differ diff --git a/areas/__pycache__/apps.cpython-38.pyc b/areas/__pycache__/apps.cpython-38.pyc index 9290f60..e7a6b78 100644 Binary files a/areas/__pycache__/apps.cpython-38.pyc and b/areas/__pycache__/apps.cpython-38.pyc differ diff --git a/areas/__pycache__/forms.cpython-38.pyc b/areas/__pycache__/forms.cpython-38.pyc index b1a2c81..c9f46ac 100644 Binary files a/areas/__pycache__/forms.cpython-38.pyc and b/areas/__pycache__/forms.cpython-38.pyc differ diff --git a/areas/__pycache__/models.cpython-38.pyc b/areas/__pycache__/models.cpython-38.pyc index 04f8d72..83d08a8 100644 Binary files a/areas/__pycache__/models.cpython-38.pyc and b/areas/__pycache__/models.cpython-38.pyc differ diff --git a/areas/__pycache__/urls.cpython-38.pyc b/areas/__pycache__/urls.cpython-38.pyc index 7683456..ddff2d1 100644 Binary files a/areas/__pycache__/urls.cpython-38.pyc and b/areas/__pycache__/urls.cpython-38.pyc differ diff --git a/areas/__pycache__/views.cpython-38.pyc b/areas/__pycache__/views.cpython-38.pyc index 0d77c06..aae0ee2 100644 Binary files a/areas/__pycache__/views.cpython-38.pyc and b/areas/__pycache__/views.cpython-38.pyc differ diff --git a/digitaleagentur/__pycache__/__init__.cpython-38.pyc b/digitaleagentur/__pycache__/__init__.cpython-38.pyc index 1ffa496..f932871 100644 Binary files a/digitaleagentur/__pycache__/__init__.cpython-38.pyc and b/digitaleagentur/__pycache__/__init__.cpython-38.pyc differ diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc index b6d9ed4..274771a 100644 Binary files a/digitaleagentur/__pycache__/settings.cpython-38.pyc and b/digitaleagentur/__pycache__/settings.cpython-38.pyc differ diff --git a/digitaleagentur/__pycache__/urls.cpython-38.pyc b/digitaleagentur/__pycache__/urls.cpython-38.pyc index 797d3e8..c4e18bc 100644 Binary files a/digitaleagentur/__pycache__/urls.cpython-38.pyc and b/digitaleagentur/__pycache__/urls.cpython-38.pyc differ diff --git a/digitaleagentur/__pycache__/views.cpython-38.pyc b/digitaleagentur/__pycache__/views.cpython-38.pyc index 268c51d..ecd32fe 100644 Binary files a/digitaleagentur/__pycache__/views.cpython-38.pyc and b/digitaleagentur/__pycache__/views.cpython-38.pyc differ diff --git a/digitaleagentur/__pycache__/wsgi.cpython-38.pyc b/digitaleagentur/__pycache__/wsgi.cpython-38.pyc index c66704f..3e8074e 100644 Binary files a/digitaleagentur/__pycache__/wsgi.cpython-38.pyc and b/digitaleagentur/__pycache__/wsgi.cpython-38.pyc differ diff --git a/digitaleagentur/urls.py b/digitaleagentur/urls.py index 80e84f1..a9f1c5d 100644 --- a/digitaleagentur/urls.py +++ b/digitaleagentur/urls.py @@ -31,7 +31,7 @@ urlpatterns = [ path('standards/', include('standards.urls'), name="standards"), path('news/', include('news.urls'), name="dashboard"), path('orga/', include('orga.urls'), name="orga"), - path('password-reset/', auth_views.PasswordResetView.as_view(template_name='users/password_reset.html'), name='password-reset'), + path('password-reset/', auth_views.PasswordResetView.as_view(template_name='users/password_reset.html', html_email_template_name='users/password_reset_mail.html'), name='password-reset'), path('password-reset/done/', auth_views.PasswordResetDoneView.as_view(template_name='users/password_reset_done.html'), name='password_reset_done'), path('password-reset-confirm///', auth_views.PasswordResetConfirmView.as_view(template_name='users/password_reset_confirm.html'), name='password_reset_confirm'), path('password-reset-complete/', auth_views.PasswordResetCompleteView.as_view(template_name='users/password_reset_complete.html'), name='password_reset_complete'), diff --git a/news/__pycache__/__init__.cpython-38.pyc b/news/__pycache__/__init__.cpython-38.pyc index 50d4891..fe38ad1 100644 Binary files a/news/__pycache__/__init__.cpython-38.pyc and b/news/__pycache__/__init__.cpython-38.pyc differ diff --git a/news/__pycache__/admin.cpython-38.pyc b/news/__pycache__/admin.cpython-38.pyc index 8692976..144b68c 100644 Binary files a/news/__pycache__/admin.cpython-38.pyc and b/news/__pycache__/admin.cpython-38.pyc differ diff --git a/news/__pycache__/apps.cpython-38.pyc b/news/__pycache__/apps.cpython-38.pyc index 45a5cfe..c643216 100644 Binary files a/news/__pycache__/apps.cpython-38.pyc and b/news/__pycache__/apps.cpython-38.pyc differ diff --git a/news/__pycache__/forms.cpython-38.pyc b/news/__pycache__/forms.cpython-38.pyc index 4f2a036..2903330 100644 Binary files a/news/__pycache__/forms.cpython-38.pyc and b/news/__pycache__/forms.cpython-38.pyc differ diff --git a/news/__pycache__/models.cpython-38.pyc b/news/__pycache__/models.cpython-38.pyc index bd27abd..b32eaa5 100644 Binary files a/news/__pycache__/models.cpython-38.pyc and b/news/__pycache__/models.cpython-38.pyc differ diff --git a/news/__pycache__/urls.cpython-38.pyc b/news/__pycache__/urls.cpython-38.pyc index 4f0ef46..329ef64 100644 Binary files a/news/__pycache__/urls.cpython-38.pyc and b/news/__pycache__/urls.cpython-38.pyc differ diff --git a/news/__pycache__/views.cpython-38.pyc b/news/__pycache__/views.cpython-38.pyc index f23ea34..069e8d5 100644 Binary files a/news/__pycache__/views.cpython-38.pyc and b/news/__pycache__/views.cpython-38.pyc differ diff --git a/orga/__pycache__/__init__.cpython-38.pyc b/orga/__pycache__/__init__.cpython-38.pyc index 5fbb46a..496d807 100644 Binary files a/orga/__pycache__/__init__.cpython-38.pyc and b/orga/__pycache__/__init__.cpython-38.pyc differ diff --git a/orga/__pycache__/admin.cpython-38.pyc b/orga/__pycache__/admin.cpython-38.pyc index 52eca0c..6513846 100644 Binary files a/orga/__pycache__/admin.cpython-38.pyc and b/orga/__pycache__/admin.cpython-38.pyc differ diff --git a/orga/__pycache__/apps.cpython-38.pyc b/orga/__pycache__/apps.cpython-38.pyc index bad2d21..52f5b45 100644 Binary files a/orga/__pycache__/apps.cpython-38.pyc and b/orga/__pycache__/apps.cpython-38.pyc differ diff --git a/orga/__pycache__/models.cpython-38.pyc b/orga/__pycache__/models.cpython-38.pyc index 0ceedb8..96f69e5 100644 Binary files a/orga/__pycache__/models.cpython-38.pyc and b/orga/__pycache__/models.cpython-38.pyc differ diff --git a/orga/__pycache__/urls.cpython-38.pyc b/orga/__pycache__/urls.cpython-38.pyc index dbd2557..442122f 100644 Binary files a/orga/__pycache__/urls.cpython-38.pyc and b/orga/__pycache__/urls.cpython-38.pyc differ diff --git a/orga/__pycache__/views.cpython-38.pyc b/orga/__pycache__/views.cpython-38.pyc index 8f8bb8b..bdc046f 100644 Binary files a/orga/__pycache__/views.cpython-38.pyc and b/orga/__pycache__/views.cpython-38.pyc differ diff --git a/standards/__pycache__/__init__.cpython-38.pyc b/standards/__pycache__/__init__.cpython-38.pyc index 10c9914..3efa48c 100644 Binary files a/standards/__pycache__/__init__.cpython-38.pyc and b/standards/__pycache__/__init__.cpython-38.pyc differ diff --git a/standards/__pycache__/admin.cpython-38.pyc b/standards/__pycache__/admin.cpython-38.pyc index 636f01b..a4a2637 100644 Binary files a/standards/__pycache__/admin.cpython-38.pyc and b/standards/__pycache__/admin.cpython-38.pyc differ diff --git a/standards/__pycache__/apps.cpython-38.pyc b/standards/__pycache__/apps.cpython-38.pyc index 4506211..4552384 100644 Binary files a/standards/__pycache__/apps.cpython-38.pyc and b/standards/__pycache__/apps.cpython-38.pyc differ diff --git a/standards/__pycache__/forms.cpython-38.pyc b/standards/__pycache__/forms.cpython-38.pyc index a2f4a40..26a019c 100644 Binary files a/standards/__pycache__/forms.cpython-38.pyc and b/standards/__pycache__/forms.cpython-38.pyc differ diff --git a/standards/__pycache__/models.cpython-38.pyc b/standards/__pycache__/models.cpython-38.pyc index fdd798a..49f2123 100644 Binary files a/standards/__pycache__/models.cpython-38.pyc and b/standards/__pycache__/models.cpython-38.pyc differ diff --git a/standards/__pycache__/urls.cpython-38.pyc b/standards/__pycache__/urls.cpython-38.pyc index 67f12f1..29e42d3 100644 Binary files a/standards/__pycache__/urls.cpython-38.pyc and b/standards/__pycache__/urls.cpython-38.pyc differ diff --git a/standards/__pycache__/views.cpython-38.pyc b/standards/__pycache__/views.cpython-38.pyc index 09985db..c6ad04a 100644 Binary files a/standards/__pycache__/views.cpython-38.pyc and b/standards/__pycache__/views.cpython-38.pyc differ diff --git a/tasks/__pycache__/__init__.cpython-38.pyc b/tasks/__pycache__/__init__.cpython-38.pyc index ba2b443..5761d3d 100644 Binary files a/tasks/__pycache__/__init__.cpython-38.pyc and b/tasks/__pycache__/__init__.cpython-38.pyc differ diff --git a/tasks/__pycache__/admin.cpython-38.pyc b/tasks/__pycache__/admin.cpython-38.pyc index 4785bcc..64cf5df 100644 Binary files a/tasks/__pycache__/admin.cpython-38.pyc and b/tasks/__pycache__/admin.cpython-38.pyc differ diff --git a/tasks/__pycache__/apps.cpython-38.pyc b/tasks/__pycache__/apps.cpython-38.pyc index acb7215..1b8289c 100644 Binary files a/tasks/__pycache__/apps.cpython-38.pyc and b/tasks/__pycache__/apps.cpython-38.pyc differ diff --git a/tasks/__pycache__/forms.cpython-38.pyc b/tasks/__pycache__/forms.cpython-38.pyc index 7d05cbf..bfae0d8 100644 Binary files a/tasks/__pycache__/forms.cpython-38.pyc and b/tasks/__pycache__/forms.cpython-38.pyc differ diff --git a/tasks/__pycache__/models.cpython-38.pyc b/tasks/__pycache__/models.cpython-38.pyc index d012e57..45cdb3b 100644 Binary files a/tasks/__pycache__/models.cpython-38.pyc and b/tasks/__pycache__/models.cpython-38.pyc differ diff --git a/tasks/__pycache__/urls.cpython-38.pyc b/tasks/__pycache__/urls.cpython-38.pyc index 065fae8..fbe82ce 100644 Binary files a/tasks/__pycache__/urls.cpython-38.pyc and b/tasks/__pycache__/urls.cpython-38.pyc differ diff --git a/tasks/__pycache__/views.cpython-38.pyc b/tasks/__pycache__/views.cpython-38.pyc index 2d837b9..c25b548 100644 Binary files a/tasks/__pycache__/views.cpython-38.pyc and b/tasks/__pycache__/views.cpython-38.pyc differ diff --git a/users/__pycache__/__init__.cpython-38.pyc b/users/__pycache__/__init__.cpython-38.pyc index 09287f9..1988400 100644 Binary files a/users/__pycache__/__init__.cpython-38.pyc and b/users/__pycache__/__init__.cpython-38.pyc differ diff --git a/users/__pycache__/admin.cpython-38.pyc b/users/__pycache__/admin.cpython-38.pyc index 131dcf0..407ba3c 100644 Binary files a/users/__pycache__/admin.cpython-38.pyc and b/users/__pycache__/admin.cpython-38.pyc differ diff --git a/users/__pycache__/apps.cpython-38.pyc b/users/__pycache__/apps.cpython-38.pyc index e12f316..cea3da8 100644 Binary files a/users/__pycache__/apps.cpython-38.pyc and b/users/__pycache__/apps.cpython-38.pyc differ diff --git a/users/__pycache__/models.cpython-38.pyc b/users/__pycache__/models.cpython-38.pyc index 0ec8d15..6a63d41 100644 Binary files a/users/__pycache__/models.cpython-38.pyc and b/users/__pycache__/models.cpython-38.pyc differ diff --git a/users/__pycache__/priomodel.cpython-38.pyc b/users/__pycache__/priomodel.cpython-38.pyc index e0c5566..f822ee2 100644 Binary files a/users/__pycache__/priomodel.cpython-38.pyc and b/users/__pycache__/priomodel.cpython-38.pyc differ diff --git a/users/__pycache__/signals.cpython-38.pyc b/users/__pycache__/signals.cpython-38.pyc index 46f1761..a854aad 100644 Binary files a/users/__pycache__/signals.cpython-38.pyc and b/users/__pycache__/signals.cpython-38.pyc differ diff --git a/users/__pycache__/urls.cpython-38.pyc b/users/__pycache__/urls.cpython-38.pyc index e92cf7a..353d16f 100644 Binary files a/users/__pycache__/urls.cpython-38.pyc and b/users/__pycache__/urls.cpython-38.pyc differ diff --git a/users/__pycache__/usersforms.cpython-38.pyc b/users/__pycache__/usersforms.cpython-38.pyc index 9f87820..c7eb2db 100644 Binary files a/users/__pycache__/usersforms.cpython-38.pyc and b/users/__pycache__/usersforms.cpython-38.pyc differ diff --git a/users/__pycache__/views.cpython-38.pyc b/users/__pycache__/views.cpython-38.pyc index cc41d65..74b5370 100644 Binary files a/users/__pycache__/views.cpython-38.pyc and b/users/__pycache__/views.cpython-38.pyc differ diff --git a/users/templates/users/password_reset_mail.html b/users/templates/users/password_reset_mail.html new file mode 100644 index 0000000..23d8f07 --- /dev/null +++ b/users/templates/users/password_reset_mail.html @@ -0,0 +1,26 @@ +{% load i18n %}{% autoescape off %} + + + + +

Digitale Agentur Passwort

+

+ Hallo {{user.first_name}} {{user.last_name}},
+ Sie haben eine neues Passwort für den Zugang ihrer Agentur {{user.profile.agency.name}} angefordert. Bitte gehen Sie auf folgenden Link, um sich ein Passwort zu setzen: + {% block reset_link %} + {{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %} + {% endblock %} + Ihr Benutzername: {{ user.get_username }} +
+ Sollten Sie kein Passwort angefordert haben, ignorieren Sie diese E-Mail. +

+

+ Vielen Dank, dass Sie die Plattform Digitale Agentur nutzen! +
+ Mit freundlichen Grüßen +

+ Ihr Team von Digitale Agentur +

+ + +{% endautoescape %} \ No newline at end of file diff --git a/users/templates/users/register_mail.html b/users/templates/users/register_mail.html new file mode 100644 index 0000000..638b62a --- /dev/null +++ b/users/templates/users/register_mail.html @@ -0,0 +1,24 @@ +{% load i18n %}{% autoescape off %} + + + + +

Digitale Agentur Registrierung

+

+ Hallo {{username}},
+ Ihre Agentur wurde erstellt. Sie können sich nun hier anmelden und ihre Agentur gestalten. +

+ Ihr Benutzername: {{ username_log }} +
+ Sollten Sie kein Passwort angefordert haben, ignorieren Sie diese E-Mail. +

+

+ Vielen Dank, dass Sie die Plattform Digitale Agentur nutzen! +
+ Mit freundlichen Grüßen +

+ Ihr Team von Digitale Agentur +

+ + +{% endautoescape %} \ No newline at end of file diff --git a/users/views.py b/users/views.py index 0dbdd1f..7e6ce66 100644 --- a/users/views.py +++ b/users/views.py @@ -21,6 +21,7 @@ from news.models import News import requests import json from PIL import Image +from django.template.loader import render_to_string ''' DASHBOARD-View @@ -42,18 +43,22 @@ class AgencyCreateView(CreateView): # SAVE OBJECTS TO SIGNALE! agency = Agency() agency.save() + newuser_name = form.cleaned_data.get('first_name') + ' ' + form.cleaned_data.get('last_name') form.instance.agency = agency - + msg_html = render_to_string('users/register_mail.html', {'username': newuser_name}) # E-Mail für Passwort-Setzung! send_mail( 'Agenturanmeldung', 'Hallo ' + form.cleaned_data.get('first_name') + ' ' + form.cleaned_data.get('last_name') + '! Bitte setzen sie sich auf https://digitale-agentur.com/password-reset/ ein Passwort. Anschließend können Sie weitere Details Ihrer Agentur eingeben.', 'support@digitale-agentur.com', - [form.cleaned_data.get('email')], - fail_silently=False, + [form.cleaned_data.get('email')], + html_message=msg_html, + fail_silently=False ) return super().form_valid(form) + + @login_required def dashboard(request):