Skip to content

Commit ec5f09d

Browse files
committed
config save override
1 parent 866bfba commit ec5f09d

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

quiz/models.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ def quiz_active(self):
7676
return False
7777
return True
7878
def save(self, force_insert=False, force_update=False, *args, **kwargs):
79-
players=UserScore.objects.all()
80-
for player in players:
81-
player.current_question=1
82-
player.save()
83-
super(config, self).save(force_insert, force_update, *args, **kwargs)
79+
if not self.pk:
80+
players=UserScore.objects.all()
81+
for player in players:
82+
player.current_question=1
83+
player.save()
84+
super(config, self).save(force_insert, force_update, *args, **kwargs)

screencast/settings.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
'account',
4343
'api',
4444
'rest_framework',
45-
#'corsheaders',
45+
'corsheaders',
4646
'rest_framework_social_oauth2',
4747
'oauth2_provider',
4848
'social_django',
@@ -95,11 +95,6 @@
9595
WSGI_APPLICATION = 'screencast.wsgi.application'
9696
CORS_ORIGIN_ALLOW_ALL = True
9797

98-
CORS_ORIGIN_WHITELIST = (
99-
'http//:localhost:8000',
100-
# add your frontend server site here
101-
)
102-
10398

10499
# Database
105100
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
@@ -116,7 +111,7 @@
116111
'ENGINE': 'django.db.backends.postgresql',
117112
'NAME': 'screencast',
118113
'USER': 'postgres',
119-
'PASSWORD': '1234',
114+
'PASSWORD': 'ramiz',
120115
'HOST': 'localhost',
121116
'PORT': '5432',
122117
}

0 commit comments

Comments
 (0)