Permalink
Browse files

Merge pull request #84 from kux/develop

Make FileFile.get_file_name cope with sitiuations where self.file.name is not set.
  • Loading branch information...
2 parents c52865d + c37a63a commit e23b33cd4cd84a85f21c1a6ad444f3403e7de4f0 @stefanfoulis stefanfoulis committed Jan 15, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 cmsplugin_filer_file/models.py
@@ -30,7 +30,11 @@ def file_exists(self):
return self.file.file.storage.exists(self.file.path)
def get_file_name(self):
- return self.file.name
+ if self.file.name in ('', None):
+ name = u"%s" % (self.file.original_filename,)
+ else:
+ name = u"%s" % (self.file.name,)
+ return name
def get_ext(self):
return self.file.extension

0 comments on commit e23b33c

Please sign in to comment.