mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Allow to delete organizers
This commit is contained in:
@@ -31,6 +31,29 @@ class OrganizerForm(I18nModelForm):
|
||||
return slug
|
||||
|
||||
|
||||
class OrganizerDeleteForm(forms.Form):
|
||||
error_messages = {
|
||||
'slug_wrong': _("The slug you entered was not correct."),
|
||||
}
|
||||
slug = forms.CharField(
|
||||
max_length=255,
|
||||
label=_("Event slug"),
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.organizer = kwargs.pop('organizer')
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def clean_slug(self):
|
||||
slug = self.cleaned_data.get('slug')
|
||||
if slug != self.organizer.slug:
|
||||
raise forms.ValidationError(
|
||||
self.error_messages['slug_wrong'],
|
||||
code='slug_wrong',
|
||||
)
|
||||
return slug
|
||||
|
||||
|
||||
class OrganizerUpdateForm(OrganizerForm):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user