Commit 08a5c988 authored by Jens Langhammer's avatar Jens Langhammer

admin: fix source creation view

parent 6c0e7b97
"""passbook core source form fields"""
# from django import forms
SOURCE_FORM_FIELDS = ['name', 'slug', 'enabled']
# class SourceForm(forms.Form)
......@@ -31,7 +31,7 @@ class SourceCreateView(SuccessMessageMixin, AdminRequiredMixin, CreateView):
def get_form_class(self):
source_type = self.request.GET.get('type')
model = next(x if x.__name__ == source_type else None for x in Source.__subclasses__())
model = next(x for x in Source.__subclasses__() if x.__name__ == source_type)
if not model:
raise Http404
return path_to_class(model.form)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment