fix some issues when c3nav is setup from ground up

This commit is contained in:
Laura Klünder 2018-11-16 00:52:13 +01:00
parent 417fd9514e
commit 27c833b3ef
3 changed files with 8 additions and 3 deletions

View file

@ -97,8 +97,8 @@ class BoundsMixin(SerializableMixin, models.Model):
return result
result = cls.objects.all().aggregate(models.Min('left'), models.Min('bottom'),
models.Max('right'), models.Max('top'))
result = ((float(result['left__min']), float(result['bottom__min'])),
(float(result['right__max']), float(result['top__max'])))
result = ((float(result['left__min'] or 0), float(result['bottom__min'] or 0)),
(float(result['right__max'] or 10), float(result['top__max'] or 10)))
cache.set(cache_key, result, 900)
return result