mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
Added password reset to control.auth
This commit is contained in:
@@ -140,8 +140,10 @@ class PasswordForgotForm(forms.Form):
|
||||
label=_('E-mail'),
|
||||
)
|
||||
|
||||
def __init__(self, event, *args, **kwargs):
|
||||
self.event = event
|
||||
def __init__(self, *args, **kwargs):
|
||||
if 'event' in kwargs:
|
||||
# Backwards compatibility
|
||||
del kwargs['event']
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def clean_email(self):
|
||||
|
||||
@@ -42,26 +42,27 @@ def mail(email: str, subject: str, template: str, context: dict=None, event: Eve
|
||||
sender = event.settings.get('mail_from') if event else settings.MAIL_FROM
|
||||
|
||||
subject = str(subject)
|
||||
prefix = event.settings.get('mail_prefix')
|
||||
if prefix:
|
||||
subject = "[%s] %s" % (prefix, subject)
|
||||
if event:
|
||||
prefix = event.settings.get('mail_prefix')
|
||||
if prefix:
|
||||
subject = "[%s] %s" % (prefix, subject)
|
||||
|
||||
body += "\r\n\r\n----\r\n"
|
||||
body += _(
|
||||
"You are receiving this e-mail because you placed an order for %s." % event.name
|
||||
)
|
||||
body += "\r\n"
|
||||
body += _(
|
||||
"You can view all of your orders at the following URL:"
|
||||
)
|
||||
body += "\r\n"
|
||||
body += build_absolute_uri(
|
||||
'presale:event.orders', kwargs={
|
||||
'event': event.slug,
|
||||
'organizer': event.organizer.slug
|
||||
}
|
||||
)
|
||||
body += "\r\n"
|
||||
body += "\r\n\r\n----\r\n"
|
||||
body += _(
|
||||
"You are receiving this e-mail because you placed an order for %s." % event.name
|
||||
)
|
||||
body += "\r\n"
|
||||
body += _(
|
||||
"You can view all of your orders at the following URL:"
|
||||
)
|
||||
body += "\r\n"
|
||||
body += build_absolute_uri(
|
||||
'presale:event.orders', kwargs={
|
||||
'event': event.slug,
|
||||
'organizer': event.organizer.slug
|
||||
}
|
||||
)
|
||||
body += "\r\n"
|
||||
try:
|
||||
return mail_send([email], subject, body, sender)
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user