load config on each request
This commit is contained in:
parent
7d37d74d3b
commit
bb816e0999
@ -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]))
|
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]))
|
return redirect(reverse('application_view', args=[application.id]))
|
||||||
|
|
||||||
|
|
||||||
class ApplicationDelete(DeleteView):
|
class ApplicationDelete(DeleteView):
|
||||||
"""
|
"""
|
||||||
Delete one or more Applications.
|
Delete one or more Applications.
|
||||||
|
@ -46,14 +46,20 @@ class Config(object):
|
|||||||
self.config[key] = loads(base64.decodestring(str(value)))
|
self.config[key] = loads(base64.decodestring(str(value)))
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
try:
|
# Had to be deactivated, because in more than one thread the values have
|
||||||
self.config
|
# to be loaded on each request.
|
||||||
except AttributeError:
|
## try:
|
||||||
self.load_config()
|
## self.config
|
||||||
|
## except AttributeError:
|
||||||
|
## self.load_config()
|
||||||
|
## try:
|
||||||
|
## return self.config[key]
|
||||||
|
## except KeyError:
|
||||||
|
## pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return self.config[key]
|
return loads(base64(ConfigStore.objects.get(key=key).value))
|
||||||
except KeyError:
|
except ConfigStore.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for receiver, value in default_config_value.send(sender='config', key=key):
|
for receiver, value in default_config_value.send(sender='config', key=key):
|
||||||
|
Loading…
Reference in New Issue
Block a user