From d439e7cd146b338af01bc348ee015273bded5d9b Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Mon, 26 Mar 2018 13:55:34 +0300 Subject: [PATCH] Fix congfig migration --- apps/config/models.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/config/models.py b/apps/config/models.py index 385717f5..5f19ba0f 100644 --- a/apps/config/models.py +++ b/apps/config/models.py @@ -21,5 +21,16 @@ class Config(models.Model): @classmethod def load(cls): - obj, created = cls.objects.get_or_create(pk=1) + try: + obj, created = cls.objects.get_or_create(pk=1) + except: + obj = { + 'INSTAGRAM_CLIENT_ACCESS_TOKEN': '', + 'INSTAGRAM_CLIENT_SECRET': '', + 'INSTAGRAM_PROFILE_URL': '', + 'SERVICE_COMMISSION': '', + 'SERVICE_DISCOUNT_MIN_AMOUNT': '', + 'SERVICE_DISCOUNT': '', + 'SCHOOL_LOGO_IMAGE': '', + } return obj