diff --git a/euth/users/adapters.py b/euth/users/adapters.py index 93039690f..543fd4f27 100644 --- a/euth/users/adapters.py +++ b/euth/users/adapters.py @@ -1,23 +1,10 @@ import re -from urllib.parse import quote from allauth.account.adapter import DefaultAccountAdapter -from django.utils.http import url_has_allowed_host_and_scheme -from adhocracy4.emails import Email -from adhocracy4.emails.mixins import SyncEmailMixin from euth.users import USERNAME_REGEX -class EuthAccountEmail(SyncEmailMixin, Email): - def get_receivers(self): - return [self.object] - - @property - def template_name(self): - return self.kwargs['template_name'] - - class EuthAccountAdapter(DefaultAccountAdapter): username_regex = re.compile(USERNAME_REGEX) @@ -31,27 +18,3 @@ def is_open_for_signup(self, request): (Comment reproduced from the overridden method.) """ return False - - def get_email_confirmation_url(self, request, emailconfirmation): - url = super().get_email_confirmation_url(request, emailconfirmation) - if 'next' in request.POST \ - and url_has_allowed_host_and_scheme(request.POST['next'], - allowed_hosts=None): - return '{}?next={}'.format(url, quote(request.POST['next'])) - else: - return url - - def send_mail(self, template_prefix, email, context): - return EuthAccountEmail.send( - email, - template_name=template_prefix, - **context - ) - - def get_email_confirmation_redirect_url(self, request): - if 'next' in request.GET \ - and url_has_allowed_host_and_scheme(request.GET['next'], - allowed_hosts=None): - return request.GET['next'] - else: - return super().get_email_confirmation_redirect_url(request) diff --git a/euth/users/templates/euth_users/indicator_menu.html b/euth/users/templates/euth_users/indicator_menu.html index d8ff432ba..dbe7d527d 100644 --- a/euth/users/templates/euth_users/indicator_menu.html +++ b/euth/users/templates/euth_users/indicator_menu.html @@ -17,10 +17,6 @@ {% endif %} -