cleared database, set productive mode

This commit is contained in:
tkupek 2016-03-05 15:12:53 +01:00
parent c78ca647e6
commit 0419d084fa
7 changed files with 31 additions and 9 deletions

Binary file not shown.

View file

@ -24,7 +24,7 @@ class UserAdmin(admin.ModelAdmin):
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):

View file

@ -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',
),
]

View file

@ -66,7 +66,7 @@ class User(models.Model):
token = models.CharField(max_length=40, null=True, default=gen_token, unique=True)
name = models.CharField(max_length=100, null=False)
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):
return self.name

View file

@ -22,10 +22,12 @@ var QueryString = function () {
}();
window.onload = init();
//window.onbeforeunload = function() {
//var message = document.getElementById("popup-leave-message").innerHTML;
//return message;
//}
window.onbeforeunload = function() {
if(document.getElementById("progressbar").style.width != "100%") {
var message = document.getElementById("popup-leave-message").innerHTML;
return message;
}
}
function init() {
enable_disable_question();

View file

@ -111,9 +111,9 @@ def get_answer(request):
progress = get_progress(user)
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
user.completed_message_shown = True
user.completed = True
user.save()
holder = {'options_id': options_id, 'progress': str(progress), 'show_completed': show_completed}

View file

@ -23,7 +23,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '_*hrxgzo(8hkrp5f8n4j9vo15acsy0b88yiy$6d5ezwi&pns(j'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = ["127.0.0.1", "localhost"]