Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Fix one of several Django 1.6 GenericRelation regressions

View gist:7441463
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
diff --git a/django/forms/models.py b/django/forms/models.py
index 6934925..4713a45 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -82,7 +82,9 @@ def save_instance(form, instance, fields=None, fail_message='saved',
# Wrap up the saving of m2m data as a function.
def save_m2m():
cleaned_data = form.cleaned_data
- for f in opts.many_to_many:
+ for f in (opts.virtual_fields + opts.many_to_many):
+ if not getattr(f, 'editable', False):
+ continue
if fields and f.name not in fields:
continue
if exclude and f.name in exclude:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.