I have an inscription form that doesn't work when submitting.
I get this error:
reverse() argument after ** must be a mapping, not str**
This is my view:
def inscription(request, seance_id):
seance = get_object_or_404(Variant, id=seance_id)
inscription_config = {'form_class': InscriptionForm,
'extra_context': {'seance': seance}}
return create_object(request, **inscription_config)
My form:
class InscriptionForm(forms.ModelForm):
class Meta:
model = Inscription
def clean(self):
cleaned_data = self.cleaned_data
email = cleaned_data.get("mail")
mail_confirmation = cleaned_data.get("mail_confirmation")
if email != mail_confirmation:
raise forms.ValidationError("Les deux adresses mails doivent correspondre")
return cleaned_data
Seems what triggering the error is inscription_config in the return statement, but I have no idea why.
EDIT
Environment:
Request Method: POST Request URL: http://127.0.0.1:8039/formations/inscription/1/ Django Version: 1.2.5 Python Version: 2.7.2 Installed Applications: ['django.contrib.auth', 'django.contrib.comments', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.admin', 'ckeditor', 'constance', 'constance.backends.database', 'custom_flatpages', 'django_extensions', 'django_mobile', 'django_xmlrpc', 'easy_thumbnails', 'gestion_formations', 'file_uploader', 'less', 'mptt', 'contact', 'newsletter', 'pagination', 'south', 'sentry', 'sentry.client', 'indexer', 'paging', 'contentadmin', 'gallerie'] Installed Middleware: ('annoying.midd