--- a/app/soc/logic/system.py Mon Mar 02 19:47:04 2009 +0000
+++ b/app/soc/logic/system.py Mon Mar 02 19:47:50 2009 +0000
@@ -37,5 +37,5 @@
def getAppVersion():
"""Returns the Google App Engine "version" of the running instance.
"""
+
return os.environ.get('CURRENT_VERSION_ID')
-
--- a/app/soc/models/site.py Mon Mar 02 19:47:04 2009 +0000
+++ b/app/soc/models/site.py Mon Mar 02 19:47:50 2009 +0000
@@ -49,6 +49,9 @@
maintenance_start = db.DateTimeProperty(
verbose_name=ugettext('Maintenance start date'))
+ maintenance_end = db.DateTimeProperty(
+ verbose_name=ugettext('Maintenance end date'))
+
#: Valid Google Analytics tracking number, if entered every page
#: is going to have Google Analytics JS initialization code in
#: the footer with the given tracking number.
--- a/app/soc/views/helper/decorators.py Mon Mar 02 19:47:04 2009 +0000
+++ b/app/soc/views/helper/decorators.py Mon Mar 02 19:47:50 2009 +0000
@@ -47,15 +47,16 @@
from soc.logic.helper import timeline
from soc.logic.models.site import logic as site_logic
+ from soc.logic.models.user import logic as user_logic
@wraps(func)
def view_wrapper(request, *args, **kwds):
site = site_logic.getSingleton()
# don't redirect admins, or if we're at /maintenance already
- no_redirect = users.is_current_user_admin() or request.path == '/maintenance'
+ no_redirect = user_logic.isDeveloper() or request.path == '/maintenance'
- if (not no_redirect) and timeline.isAfterEvent(site, 'maintenance_start'):
+ if (not no_redirect) and timeline.isActivePeriod(site, 'maintenance'):
return http.HttpResponseRedirect('/maintenance')
try: