Allow creating KnownDomains in the interface

This commit is contained in:
Raphael Michel
2017-04-26 12:05:53 +02:00
parent 010c31cf10
commit bee61bf398
3 changed files with 43 additions and 0 deletions

View File

@@ -205,6 +205,12 @@ class OrganizerUpdate(OrganizerPermissionRequiredMixin, UpdateView):
messages.success(self.request, _('Your changes have been saved.'))
return super().form_valid(form)
def get_form_kwargs(self):
kwargs = super().get_form_kwargs()
if self.request.user.is_superuser:
kwargs['domain'] = True
return kwargs
def get_success_url(self) -> str:
return reverse('control:organizer.edit', kwargs={
'organizer': self.request.organizer.slug,