diff --git a/passbook/admin/forms/__init__.py b/passbook/admin/forms/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/passbook/admin/forms/source.py b/passbook/admin/forms/source.py new file mode 100644 index 000000000..25052bb4a --- /dev/null +++ b/passbook/admin/forms/source.py @@ -0,0 +1,6 @@ +"""passbook core source form fields""" +# from django import forms + +SOURCE_FORM_FIELDS = ['name', 'slug', 'enabled'] + +# class SourceForm(forms.Form) diff --git a/passbook/admin/views/sources.py b/passbook/admin/views/sources.py index b922b70ae..288b133ca 100644 --- a/passbook/admin/views/sources.py +++ b/passbook/admin/views/sources.py @@ -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)