diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-05-26 17:24:35 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-05-26 17:24:35 +0200 |
commit | 1af69d67f354b62cafdd49b9b4d4453c6b5354b1 (patch) | |
tree | 348340661a466900161376d81300eb0500848102 /chimere/models.py | |
parent | 58c181b8792466834512c85f8f19b8daf1d79c2d (diff) | |
download | Chimère-1af69d67f354b62cafdd49b9b4d4453c6b5354b1.tar.bz2 Chimère-1af69d67f354b62cafdd49b9b4d4453c6b5354b1.zip |
Forms: do not choose between categories if only one is available
Diffstat (limited to 'chimere/models.py')
-rw-r--r-- | chimere/models.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chimere/models.py b/chimere/models.py index ddeeefd..25b599b 100644 --- a/chimere/models.py +++ b/chimere/models.py @@ -1853,6 +1853,8 @@ class PropertyModel(models.Model): @classmethod def getAvailable(cls, area_name=None): + if area_name and area_name.endswith('/'): + area_name = area_name[:-1] q = cls.objects.filter(available=True) if not area_name: return q.annotate(Count('areas')).filter(areas__count=0) |