cleared database, set productive mode
This commit is contained in:
parent
c78ca647e6
commit
0419d084fa
7 changed files with 31 additions and 9 deletions
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
|
@ -24,7 +24,7 @@ class UserAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
def get_readonly_fields(self, request, obj=None):
|
def get_readonly_fields(self, request, obj=None):
|
||||||
|
|
||||||
return self.readonly_fields + ('token', 'last_seen')
|
return self.readonly_fields + ('token', 'last_seen', 'completed')
|
||||||
|
|
||||||
|
|
||||||
class SettingAdmin(admin.ModelAdmin):
|
class SettingAdmin(admin.ModelAdmin):
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.9.1 on 2016-03-05 14:09
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('elearning', '0028_auto_20160305_1338'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='user',
|
||||||
|
old_name='completed_message_shown',
|
||||||
|
new_name='completed',
|
||||||
|
),
|
||||||
|
]
|
|
@ -66,7 +66,7 @@ class User(models.Model):
|
||||||
token = models.CharField(max_length=40, null=True, default=gen_token, unique=True)
|
token = models.CharField(max_length=40, null=True, default=gen_token, unique=True)
|
||||||
name = models.CharField(max_length=100, null=False)
|
name = models.CharField(max_length=100, null=False)
|
||||||
last_seen = models.DateTimeField(null=True, blank=True)
|
last_seen = models.DateTimeField(null=True, blank=True)
|
||||||
completed_message_shown = models.BooleanField(null=False, default=False)
|
completed = models.BooleanField(null=False, default=False)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
|
@ -22,10 +22,12 @@ var QueryString = function () {
|
||||||
}();
|
}();
|
||||||
|
|
||||||
window.onload = init();
|
window.onload = init();
|
||||||
//window.onbeforeunload = function() {
|
window.onbeforeunload = function() {
|
||||||
//var message = document.getElementById("popup-leave-message").innerHTML;
|
if(document.getElementById("progressbar").style.width != "100%") {
|
||||||
//return message;
|
var message = document.getElementById("popup-leave-message").innerHTML;
|
||||||
//}
|
return message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
enable_disable_question();
|
enable_disable_question();
|
||||||
|
|
|
@ -111,9 +111,9 @@ def get_answer(request):
|
||||||
|
|
||||||
progress = get_progress(user)
|
progress = get_progress(user)
|
||||||
show_completed = False
|
show_completed = False
|
||||||
if progress is 100 and user.completed_message_shown is False:
|
if progress is 100 and user.completed is False:
|
||||||
show_completed = True
|
show_completed = True
|
||||||
user.completed_message_shown = True
|
user.completed = True
|
||||||
user.save()
|
user.save()
|
||||||
|
|
||||||
holder = {'options_id': options_id, 'progress': str(progress), 'show_completed': show_completed}
|
holder = {'options_id': options_id, 'progress': str(progress), 'show_completed': show_completed}
|
||||||
|
|
|
@ -23,7 +23,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
SECRET_KEY = '_*hrxgzo(8hkrp5f8n4j9vo15acsy0b88yiy$6d5ezwi&pns(j'
|
SECRET_KEY = '_*hrxgzo(8hkrp5f8n4j9vo15acsy0b88yiy$6d5ezwi&pns(j'
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = False
|
||||||
|
|
||||||
ALLOWED_HOSTS = ["127.0.0.1", "localhost"]
|
ALLOWED_HOSTS = ["127.0.0.1", "localhost"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue