Баг фикс

main
through-your-tears 9 months ago
parent d2b310d0bd
commit 577ba0a866

@ -14,11 +14,8 @@ class LocationRepository(BaseRepository):
model = Location model = Location
@classmethod @classmethod
def get_or_create(cls, coords, address, region=None): def get_or_create(cls, coords, address):
if region is None: region, _ = Region.objects.get_or_create(code=23)
region = Region.objects.get_or_create(code=23)
else:
region = Region.objects.get(code=region)
try: try:
return Location.objects.get(coords=coords) return Location.objects.get(coords=coords)
except ObjectDoesNotExist: except ObjectDoesNotExist:

Loading…
Cancel
Save