mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
User management UI for system administrators
This commit is contained in:
@@ -25,8 +25,7 @@ from pretix.base.forms.auth import (
|
||||
LoginForm, PasswordForgotForm, PasswordRecoverForm, RegistrationForm,
|
||||
)
|
||||
from pretix.base.models import TeamInvite, U2FDevice, User
|
||||
from pretix.base.services.mail import SendMailException, mail
|
||||
from pretix.helpers.urls import build_absolute_uri
|
||||
from pretix.base.services.mail import SendMailException
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -200,15 +199,7 @@ class Forgot(TemplateView):
|
||||
rc.setex('pretix_pwreset_%s' % (user.id), 3600 * 24, '1')
|
||||
|
||||
try:
|
||||
mail(
|
||||
user.email, _('Password recovery'), 'pretixcontrol/email/forgot.txt',
|
||||
{
|
||||
'user': user,
|
||||
'url': (build_absolute_uri('control:auth.forgot.recover')
|
||||
+ '?id=%d&token=%s' % (user.id, default_token_generator.make_token(user)))
|
||||
},
|
||||
None, locale=user.locale
|
||||
)
|
||||
user.send_password_reset()
|
||||
except SendMailException:
|
||||
messages.error(request, _('There was an error sending the mail. Please try again later.'))
|
||||
return self.get(request, *args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user