diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-08-17 16:11:58 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-08-17 16:11:58 +0200 |
commit | f9af404b06c54d0401459d4e18ec08a7db602a28 (patch) | |
tree | f5951ac699ff60c05cae9cc8cd0e026080f17c52 /archaeological_files/models.py | |
parent | 83cda4b1d3d7b2c26f93b5005944f124ad6e7bf5 (diff) | |
download | Ishtar-f9af404b06c54d0401459d4e18ec08a7db602a28.tar.bz2 Ishtar-f9af404b06c54d0401459d4e18ec08a7db602a28.zip |
File: don't get history for closing if there is no history
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r-- | archaeological_files/models.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 1910de7d6..8e871e000 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -314,7 +314,10 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem, def closing(self): if self.is_active(): return - for item in self.history.all(): + q = self.history + if not q.count(): + return {'date':None, 'user':None} + for item in q.all(): if not item.end_date: break return {'date':item.history_date, |