diff --git a/db.sqlite3 b/db.sqlite3 index 08a2f87..3203e04 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/tkupek_elearning/elearning/admin.py b/tkupek_elearning/elearning/admin.py index 996a8b3..5adec31 100644 --- a/tkupek_elearning/elearning/admin.py +++ b/tkupek_elearning/elearning/admin.py @@ -22,6 +22,11 @@ class UserAdmin(admin.ModelAdmin): UserAnswerInline, ] + def get_readonly_fields(self, request, obj=None): + + return self.readonly_fields + ('token', 'last_seen') + + admin.site.register(Question, QuestionAdmin) admin.site.register(Setting), admin.site.register(User, UserAdmin) diff --git a/tkupek_elearning/elearning/models.py b/tkupek_elearning/elearning/models.py index 44defd0..155c696 100644 --- a/tkupek_elearning/elearning/models.py +++ b/tkupek_elearning/elearning/models.py @@ -50,7 +50,7 @@ class User(models.Model): token = models.CharField(max_length=40, null=True, default=gen_token) name = models.CharField(max_length=100, null=False) - last_seen = models.DateTimeField(null=True) + last_seen = models.DateTimeField(null=True, blank=True) def __unicode__(self): return self.name