From 577ba0a866ae4a65606f4582a025371e8d38aaae Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sat, 6 Apr 2024 21:51:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=B0=D0=B3=20=D1=84=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/organizations/repositories.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/organizations/repositories.py b/src/organizations/repositories.py index 6703f11..eab2762 100644 --- a/src/organizations/repositories.py +++ b/src/organizations/repositories.py @@ -14,11 +14,8 @@ class LocationRepository(BaseRepository): model = Location @classmethod - def get_or_create(cls, coords, address, region=None): - if region is None: - region = Region.objects.get_or_create(code=23) - else: - region = Region.objects.get(code=region) + def get_or_create(cls, coords, address): + region, _ = Region.objects.get_or_create(code=23) try: return Location.objects.get(coords=coords) except ObjectDoesNotExist: