{{{
Traceback (most recent call last):
File "/vagrant/evap/staff/tests/test_forms.py", line 105, in
test_single_result_form_saves_participant_and_voter_count
self.assertTrue(form.is_valid())
File "/vagrant/src/django/django/forms/forms.py", line 161, in is_valid
return self.is_bound and not self.errors
File "/vagrant/src/django/django/forms/forms.py", line 153, in errors
self.full_clean()
File "/vagrant/src/django/django/forms/forms.py", line 364, in
full_clean
self._post_clean()
File "/vagrant/src/django/django/forms/models.py", line 401, in
_post_clean
self.instance = construct_instance(self, self.instance, opts.fields,
opts.exclude)
File "/vagrant/src/django/django/forms/models.py", line 60, in
construct_instance
f.save_form_data(instance, cleaned_data[f.name])
File "/vagrant/src/django/django/db/models/fields/__init__.py", line
867, in save_form_data
setattr(instance, self.name, data)
File
"/vagrant/src/django/django/db/models/fields/related_descriptors.py", line
203, in __set__
self.field.remote_field.model._meta.object_name,
ValueError: Cannot assign "1": "Course.semester" must be a "Semester"
instance.
}}}
code for the form is [https://github.com/fsr-
itse/EvaP/blob/b6222413f15fc7256622a31f7045046f7be1e466/evap/staff/forms.py#L149
here] (it's about the semester attribute, and ignore the two methods, this
also fails when removing those) and test is [https://github.com/fsr-
itse/EvaP/blob/b6222413f15fc7256622a31f7045046f7be1e466/evap/staff/tests/test_forms.py#L104
here].
this regressed in db19619545dd99a1d2502c72974d79eca33acff7.
--
Ticket URL: <https://code.djangoproject.com/ticket/26917>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* component: Uncategorized => Forms
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/26917#comment:1>
* stage: Unreviewed => Accepted
* severity: Normal => Release blocker
--
Ticket URL: <https://code.djangoproject.com/ticket/26917#comment:2>
* status: new => assigned
* owner: nobody => rjschave
--
Ticket URL: <https://code.djangoproject.com/ticket/26917#comment:3>
* Attachment
"Refs__26917___Added_test_to_duplicate_problem___Added_test_to_duplicate_problem_in_which_a.patch"
added.
Added unit test to duplicate problem
* cc: claudep (added)
Comment:
Claude, I'm not sure how to proceed here. It seems that the assumption
about "Initial values are supposed to be clean" isn't correct for foreign
keys. They're converted to primary key in `model_to_dict` and (previously)
back to model instances in `clean()`. Now that latter conversion is
skipped.
--
Ticket URL: <https://code.djangoproject.com/ticket/26917#comment:4>
Comment (by claudep):
If we don't find a better solution, we could partially revert that faulty
part of the patch, like I did when backporting to 1.9 (#25532). But then a
disabled `JSONField` will be non-functional. It may be less critical,
though.
--
Ticket URL: <https://code.djangoproject.com/ticket/26917#comment:5>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/6972 PR] to partially revert and
add the regression test from Ryan.
I created #26949 for the issue about disabled `JSONField`'s crashing.
--
Ticket URL: <https://code.djangoproject.com/ticket/26917#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"a5f85d891b51d7ceb4f9e422e3e4f5c741062288" a5f85d89]:
{{{
#!CommitTicketReference repository=""
revision="a5f85d891b51d7ceb4f9e422e3e4f5c741062288"
Fixed #26917 -- Fixed crash in disabled ModelChoiceFields.
Partially reverted refs #25532 to fix a regression in Django 1.10.
This reintroduces a crash for disabled forms.JSONField (refs #26949),
however, that issue is also present on Django 1.9.
Thanks Ryan Schave for the test.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26917#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"3744fc1666c41aeb4ed44f31605bafdb413b42bc" 3744fc1]:
{{{
#!CommitTicketReference repository=""
revision="3744fc1666c41aeb4ed44f31605bafdb413b42bc"
[1.10.x] Fixed #26917 -- Fixed crash in disabled ModelChoiceFields.
Partially reverted refs #25532 to fix a regression in Django 1.10.
This reintroduces a crash for disabled forms.JSONField (refs #26949),
however, that issue is also present on Django 1.9.
Thanks Ryan Schave for the test.
Backport of a5f85d891b51d7ceb4f9e422e3e4f5c741062288 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26917#comment:8>