Merge branch 'master' of mowoe.com:reverend/lostplaces-backend into master

This commit is contained in:
reverend 2020-08-28 14:34:11 +02:00
commit 751d4c81fe

View File

@ -29,7 +29,7 @@ class Voucher(models.Model):
Creation date is being set automatically during voucher creation.
"""
code = models.CharField(unique=True, max_length=10)
code = models.CharField(unique=True, max_length=30)
created = models.DateTimeField(auto_now_add=True)
expires = models.DateField()
@ -63,10 +63,13 @@ class Place (models.Model):
longitude = 0
latitude = 0
for place in place_list:
longitude += place.longitude
latitude += place.latitude
return (latitude / amount, longitude / amount)
if amount > 0:
for place in place_list:
longitude += place.longitude
latitude += place.latitude
return (latitude / amount, longitude / amount)
return (latitude, longitude)
def __str__(self):
return self.name