# HG changeset patch # User Brian Neal # Date 1368583367 18000 # Node ID 15dbe0ccda956f99eb1b6f70653a25432df2b3a3 # Parent 0dd84cff2477dad1f5ba7f79f4c495dc17372d56 Prevent exceptions when viewing downloads in the admin when the file doesn't exist on the filesystem. This is usually seen in development but can also happen in production if the file is missing. diff -r 0dd84cff2477 -r 15dbe0ccda95 downloads/models.py --- a/downloads/models.py Tue May 14 21:01:40 2013 -0500 +++ b/downloads/models.py Tue May 14 21:02:47 2013 -0500 @@ -64,7 +64,10 @@ abstract = True def size(self): - return filesizeformat(self.file.size) + try: + return filesizeformat(self.file.size) + except OSError: + return '?' class PendingDownload(DownloadBase):