context_processors.py 354 Bytes
# -*- coding: utf-8 -*-

def error_proc(request):
  if request.session.get('error', ''):
    error = request.session.pop('error')
    return {'error': error}
  else:
    return {}

def message_proc(request):
  if request.session.get('message', ''):
    message = request.session.pop('message')
    return {'alert_message': message}
  else:
    return {}