Permalink
Browse files

only do fixAutoId for primary file fields

  • Loading branch information...
1 parent eee5171 commit 6f11bb997e7fc90d18a72f186b444363f2f0bac5 @davisagli davisagli committed Jan 31, 2013
Showing with 5 additions and 1 deletion.
  1. +3 −1 CHANGES.rst
  2. +2 −0 src/plone/app/blob/field.py
View
@@ -4,7 +4,9 @@ Changelog
1.5.7 (unreleased)
------------------
-- Nothing changed yet.
+- Only set the instance id from the name of an uploaded file
+ if the file field is primary.
+ [davisagli]
1.5.6 (2013-01-09)
@@ -252,6 +252,8 @@ def fixAutoId(self, instance):
""" if an explicit id was given and the instance still has the
auto-generated one it should be renamed; also see
`_setATCTFileContent` in ATCT's `ATCTFileContent` class """
+ if not self.primary:
+ return
filename = self.getFilename(instance)
if filename is not None and instance._isIDAutoGenerated(instance.getId()):
request = instance.REQUEST

0 comments on commit 6f11bb9

Please sign in to comment.