diff options
author | prathamesh | 2017-03-13 13:36:59 +0530 |
---|---|---|
committer | prathamesh | 2017-03-13 13:36:59 +0530 |
commit | 9ebedf2865963d2c2306b5c31b829f409a9bc2da (patch) | |
tree | bc975c07e1fbc9b6e394e94f542ad0b4d8f66bcb | |
parent | 4ce30381757815f851fce701ee61d86001a6624b (diff) | |
download | online_test-9ebedf2865963d2c2306b5c31b829f409a9bc2da.tar.gz online_test-9ebedf2865963d2c2306b5c31b829f409a9bc2da.tar.bz2 online_test-9ebedf2865963d2c2306b5c31b829f409a9bc2da.zip |
Removed a function call to datetime now in default quiz start time.
Every time when we run makemigrations, model changes are detected.
"Alter field start_date_time on quiz" was always detected, even if you
have not mode any changes to the models!
This was happening because of default time value was datetime.now().
So every time when you ran migrations current datetime was set which will
always change.
Now removed parenthesis(), so that now function is not called.
And no unnecessary model changes will be detected
-rw-r--r-- | yaksh/models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 398f508..8709710 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -532,7 +532,7 @@ class Quiz(models.Model): # The start date of the quiz. start_date_time = models.DateTimeField( "Start Date and Time of the quiz", - default=timezone.now(), + default=timezone.now, null=True ) |