diff --git a/db.sqlite3 b/db.sqlite3 index 7596d46..a9a1bac 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/tkupek_elearning/elearning/templates/setting_null.html b/tkupek_elearning/elearning/templates/setting_null.html new file mode 100644 index 0000000..6afe8ec --- /dev/null +++ b/tkupek_elearning/elearning/templates/setting_null.html @@ -0,0 +1,37 @@ + + + + + + + {% load staticfiles %} + + + + + {{ settings.title }} + + + + + + + + + + +
+ +

Settings are not set. Please configure the service first!

+ + + +
+ + + \ No newline at end of file diff --git a/tkupek_elearning/elearning/views.py b/tkupek_elearning/elearning/views.py index be7950a..72379ac 100644 --- a/tkupek_elearning/elearning/views.py +++ b/tkupek_elearning/elearning/views.py @@ -27,7 +27,13 @@ def start(request): except ObjectDoesNotExist: user = None - settings = Setting.objects.get(active=1) + try: + settings = Setting.objects.get(active=1) + except ObjectDoesNotExist: + settings = None + + if settings is None: + return render_to_response('setting_null.html') if user is not None: