mysociety / yournextrepresentative

A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk/
GNU Affero General Public License v3.0
56 stars 21 forks source link

the post selector is missing from person-create pages #419

Closed mhl closed 9 years ago

mhl commented 9 years ago

e.g. /election/senadores-argentina-paso-2015/person/create/

If you try to create the person anyway, you get this error:

Internal Server Error: /election/senadores-argentina-paso-2015/person/create/
Traceback (most recent call last):
  File "/data/vhost/argentina.ynr.staging.mysociety.org/venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/data/vhost/argentina.ynr.staging.mysociety.org/venv/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/data/vhost/argentina.ynr.staging.mysociety.org/yournextmp-popit/elections/mixins.py", line 12, in dispatch
    return super(ElectionMixin, self).dispatch(request, *args, **kwargs)
  File "/data/vhost/argentina.ynr.staging.mysociety.org/venv/lib/python2.7/site-packages/braces/views/_access.py", line 64, in dispatch
    request, *args, **kwargs)
  File "/data/vhost/argentina.ynr.staging.mysociety.org/venv/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)
  File "/data/vhost/argentina.ynr.staging.mysociety.org/venv/lib/python2.7/site-packages/django/views/generic/edit.py", line 172, in post
    if form.is_valid():
  File "/data/vhost/argentina.ynr.staging.mysociety.org/venv/lib/python2.7/site-packages/django/forms/forms.py", line 162, in is_valid
    return self.is_bound and not bool(self.errors)
  File "/data/vhost/argentina.ynr.staging.mysociety.org/venv/lib/python2.7/site-packages/django/forms/forms.py", line 154, in errors
    self.full_clean()
  File "/data/vhost/argentina.ynr.staging.mysociety.org/venv/lib/python2.7/site-packages/django/forms/forms.py", line 354, in full_clean
    self._clean_form()
  File "/data/vhost/argentina.ynr.staging.mysociety.org/venv/lib/python2.7/site-packages/django/forms/forms.py", line 378, in _clean_form
    cleaned_data = self.clean()
  File "/data/vhost/argentina.ynr.staging.mysociety.org/yournextmp-popit/candidates/forms.py", line 228, in clean
    return self.check_party_and_constituency_are_selected(cleaned_data)
  File "/data/vhost/argentina.ynr.staging.mysociety.org/yournextmp-popit/candidates/forms.py", line 153, in check_party_and_constituency_are_selected
    constituency = cleaned_data['constituency_' + election]
KeyError: u'constituency_senadores-argentina-paso-2015'
mhl commented 9 years ago

Fixed in 481859e0f0c2c7