load config on each request

This commit is contained in:
Oskar Hahn 2012-06-09 19:39:52 +02:00
parent 7d37d74d3b
commit bb816e0999
2 changed files with 13 additions and 6 deletions

View File

@ -410,6 +410,7 @@ def delete_poll(request, poll_id):
del_confirm_form(request, poll, name=_("the %s. poll") % count, delete_link=reverse('application_poll_delete', args=[poll_id]))
return redirect(reverse('application_view', args=[application.id]))
class ApplicationDelete(DeleteView):
"""
Delete one or more Applications.

View File

@ -46,14 +46,20 @@ class Config(object):
self.config[key] = loads(base64.decodestring(str(value)))
def __getitem__(self, key):
try:
self.config
except AttributeError:
self.load_config()
# Had to be deactivated, because in more than one thread the values have
# to be loaded on each request.
## try:
## self.config
## except AttributeError:
## self.load_config()
## try:
## return self.config[key]
## except KeyError:
## pass
try:
return self.config[key]
except KeyError:
return loads(base64(ConfigStore.objects.get(key=key).value))
except ConfigStore.DoesNotExist:
pass
for receiver, value in default_config_value.send(sender='config', key=key):