Author: jezdez
Date: 2010-02-01 08:13:21 -0600 (Mon, 01 Feb 2010)
New Revision: 12367

Modified:
   django/trunk/django/contrib/contenttypes/generic.py
Log:
Fixed #12628 - Don't ignore read-only fields in GenericInlineModelAdmin during 
save. Thanks, Alex Gaynor.

Modified: django/trunk/django/contrib/contenttypes/generic.py
===================================================================
--- django/trunk/django/contrib/contenttypes/generic.py 2010-02-01 14:12:56 UTC 
(rev 12366)
+++ django/trunk/django/contrib/contenttypes/generic.py 2010-02-01 14:13:21 UTC 
(rev 12367)
@@ -379,6 +379,12 @@
             fields = flatten_fieldsets(self.declared_fieldsets)
         else:
             fields = None
+        if self.exclude is None:
+            exclude = []
+        else:
+            exclude = list(self.exclude)
+        exclude.extend(self.get_readonly_fields(request, obj))
+        exclude = exclude or None
         defaults = {
             "ct_field": self.ct_field,
             "fk_field": self.ct_fk_field,
@@ -390,7 +396,7 @@
             "can_order": False,
             "fields": fields,
             "max_num": self.max_num,
-            "exclude": self.exclude
+            "exclude": exclude
         }
         return generic_inlineformset_factory(self.model, **defaults)
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to