Skip to content

Commit

Permalink
Fix parsers tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gutard committed Jul 20, 2015
1 parent d0eefe2 commit 053623e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion geotrek/common/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def save_attachments(self, src, val):
url = self.base_url + url
name = os.path.basename(url)
found = False
for attachment in self.attachments_to_delete[self.obj.pk]:
for attachment in self.attachments_to_delete.get(self.obj.pk, set()):
upload_name, ext = os.path.splitext(attachment_upload(attachment, name))
existing_name = attachment.attachment_file.name
if re.search(ur"^{name}(_\d+)?{ext}$".format(name=upload_name, ext=ext), existing_name):
Expand Down

0 comments on commit 053623e

Please sign in to comment.