Make FileFile.get_file_name cope with sitiuations where self.file.name is not set. #84

Merged
merged 1 commit into from Jan 15, 2013
@@ -32,7 +32,11 @@ def file_exists(self):
return 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