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. 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) created = models.DateTimeField(auto_now_add=True)
expires = models.DateField() expires = models.DateField()
@ -63,11 +63,14 @@ class Place (models.Model):
longitude = 0 longitude = 0
latitude = 0 latitude = 0
if amount > 0:
for place in place_list: for place in place_list:
longitude += place.longitude longitude += place.longitude
latitude += place.latitude latitude += place.latitude
return (latitude / amount, longitude / amount) return (latitude / amount, longitude / amount)
return (latitude, longitude)
def __str__(self): def __str__(self):
return self.name return self.name