diff options
author | Prabhu Ramachandran | 2016-07-08 07:57:40 -0500 |
---|---|---|
committer | GitHub | 2016-07-08 07:57:40 -0500 |
commit | 7564d453228cfebf4709cbbd19609f0614b6b9bc (patch) | |
tree | 55818b1927be1d927b469bdc937c561f6c3145e2 /yaksh/models.py | |
parent | 67f77a6a05ed722609ec2fc74e2ba10751c70e08 (diff) | |
parent | 2986a8a92b0548b3e7e960aea1c175bb4eddac11 (diff) | |
download | online_test-7564d453228cfebf4709cbbd19609f0614b6b9bc.tar.gz online_test-7564d453228cfebf4709cbbd19609f0614b6b9bc.tar.bz2 online_test-7564d453228cfebf4709cbbd19609f0614b6b9bc.zip |
Merge pull request #104 from ankitjavalkar/view-tests
Add tests for views
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 7035d1e..c48eef1 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -42,7 +42,7 @@ test_case_types = ( attempts = [(i, i) for i in range(1, 6)] attempts.append((-1, 'Infinite')) -days_between_attempts = ((j, j) for j in range(401)) +days_between_attempts = [(j, j) for j in range(401)] test_status = ( ('inprogress', 'Inprogress'), @@ -58,6 +58,10 @@ def get_model_class(model): return model_class +def has_profile(user): + """ check if user has profile """ + return True if hasattr(user, 'profile') else False + ############################################################################### class CourseManager(models.Manager): @@ -159,7 +163,7 @@ class Profile(models.Model): department = models.CharField(max_length=64) position = models.CharField(max_length=64) timezone = models.CharField(max_length=64, - choices=[(tz, tz) for tz in pytz.common_timezones]) + choices=[(tz, tz) for tz in pytz.common_timezones]) ############################################################################### |