Automatic update checks (#434)

* Basic update checks

* Fix issues pointed out by @rixx

* First test

* Add tests

* Even more tests
This commit is contained in:
Raphael Michel
2017-04-01 15:34:34 +02:00
committed by GitHub
parent 867a8132aa
commit 4919f8991c
17 changed files with 625 additions and 12 deletions

View File

@@ -3,6 +3,8 @@ import sys
from django.conf import settings
from django.core.urlresolvers import Resolver404, get_script_prefix, resolve
from pretix.base.settings import GlobalSettingsObject
from .signals import html_head, nav_event, nav_topbar
from .utils.i18n import get_javascript_format, get_moment_locale
@@ -53,4 +55,13 @@ def contextprocessor(request):
elif 'runserver' in sys.argv:
ctx['development_warning'] = True
ctx['warning_update_available'] = False
ctx['warning_update_check_active'] = False
if request.user.is_superuser:
gs = GlobalSettingsObject()
if gs.settings.update_check_result_warning:
ctx['warning_update_available'] = True
if not gs.settings.update_check_ack and 'runserver' not in sys.argv:
ctx['warning_update_check_active'] = True
return ctx