OpenSlides/openslides/utils/signals.py
Norman Jäckel 21ff62dd32 Changes in projector and core app and in utils.
Changed api for main menu entries.
Enhanced http error pages using a classed based views.
Moved dashboard and select widgets view from projector to core app.
Also some small clean ups.
2014-01-10 16:17:54 +01:00

18 lines
550 B
Python

# -*- coding: utf-8 -*-
from django.dispatch import Signal
class TemplateManipulationSignal(Signal):
"""
Derived class to ensure that the key extra_stylefiles and extra_javascript
exist in the context dictionary.
"""
def send(self, **kwargs):
kwargs['context'].setdefault('extra_stylefiles', [])
kwargs['context'].setdefault('extra_javascript', [])
return super(TemplateManipulationSignal, self).send(**kwargs)
template_manipulation = TemplateManipulationSignal(providing_args=['request', 'context'])