Note that there are some explanatory texts on larger screens.

plurals
  1. POreverse() argument after ** must be a mapping
    primarykey
    data
    text
    <p>I have an inscription form that doesnt work when submitting</p> <p>I get this error : </p> <p><strong>reverse() argument after ** must be a mapping, not str</strong></p> <p>This is my view : </p> <pre><code>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) </code></pre> <p>My form :</p> <pre><code>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 </code></pre> <p>Seems what triggering the error is <strong>**inscription_config</strong> in the return statement</p> <p>But I have no idea why, and I've been looking since yesterday</p> <p><strong>EDIT</strong></p> <pre><code>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.middlewares.StaticServe', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'pagination.middleware.PaginationMiddleware') Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 100. response = callback(request, *callback_args, **callback_kwargs) File "/home/anass/projects/c139_fc_finance/fc_finance/gestion_formations/views/carts.py" in inscription 24. form_class= InscriptionForm File "/usr/local/lib/python2.7/dist-packages/django/views/generic/create_update.py" in create_object 118. return redirect(post_save_redirect, new_object) File "/usr/local/lib/python2.7/dist-packages/django/views/generic/create_update.py" in redirect 65. return HttpResponseRedirect(obj.get_absolute_url()) File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py" in _curried 55. return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs)) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py" in get_absolute_url 969. return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.module_name), func)(self, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/__init__.py" in inner 32. return reverse(bits[0], None, *bits[1:3]) File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in reverse 351. *args, **kwargs))) Exception Type: TypeError at /formations/inscription/1/ Exception Value: reverse() argument after ** must be a mapping, not str </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload