diff --git a/db.sqlite3 b/db.sqlite3 index 7c942b4..c2c5383 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 ea46478..fe36c51 100644 --- a/tkupek_elearning/elearning/admin.py +++ b/tkupek_elearning/elearning/admin.py @@ -27,6 +27,11 @@ class UserAdmin(admin.ModelAdmin): return self.readonly_fields + ('token', 'last_seen') +class SettingAdmin(admin.ModelAdmin): + def get_readonly_fields(self, request, obj=None): + + return self.readonly_fields + ('statistic_token',) + admin.site.register(Question, QuestionAdmin) -admin.site.register(Setting), +admin.site.register(Setting, SettingAdmin), admin.site.register(User, UserAdmin) diff --git a/tkupek_elearning/elearning/migrations/0024_auto_20160305_1222.py b/tkupek_elearning/elearning/migrations/0024_auto_20160305_1222.py new file mode 100644 index 0000000..66d625d --- /dev/null +++ b/tkupek_elearning/elearning/migrations/0024_auto_20160305_1222.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.1 on 2016-03-05 12:22 +from __future__ import unicode_literals + +from django.db import migrations, models +import tkupek_elearning.elearning.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('elearning', '0023_auto_20160305_1158'), + ] + + operations = [ + migrations.RemoveField( + model_name='setting', + name='token', + ), + migrations.AddField( + model_name='setting', + name='statistic_token', + field=models.CharField(default=tkupek_elearning.elearning.models.gen_token, max_length=40, null=True, unique=True), + ), + ] diff --git a/tkupek_elearning/elearning/models.py b/tkupek_elearning/elearning/models.py index 6a3469f..4e4f6f3 100644 --- a/tkupek_elearning/elearning/models.py +++ b/tkupek_elearning/elearning/models.py @@ -22,7 +22,7 @@ class Setting(models.Model): text_next = models.CharField(max_length=100, null=True) logo = models.CharField(max_length=256, null=False) active = models.BooleanField(unique=True, default=False) - token = models.CharField(max_length=40, null=True, default=gen_token) + statistic_token = models.CharField(max_length=40, null=True, default=gen_token, unique=True) def __unicode__(self): return self.title diff --git a/tkupek_elearning/elearning/templates/elearning.html b/tkupek_elearning/elearning/templates/elearning.html index 67b8913..7ca0743 100644 --- a/tkupek_elearning/elearning/templates/elearning.html +++ b/tkupek_elearning/elearning/templates/elearning.html @@ -24,7 +24,7 @@
{{ settings.message_welcome_user }}
+{{ settings.message_welcome_user|safe }}