mirror of
https://github.com/bugsink/bugsink.git
synced 2026-02-05 05:19:45 -06:00
Setting of value: outside 'try'
if inside, an error in self.get_tenant() results in an non-executable finally block. Also: make the 'del' more defensive by making it a 'pop'
This commit is contained in:
@@ -56,11 +56,11 @@ class DatabaseWrapper(TimedDatabaseWrapper):
|
||||
|
||||
def get_connection_params(self):
|
||||
# We just mutate the settings_dict here (the alternative is waaay too much copy-pasting), mutating back after.
|
||||
self.settings_dict["NAME"] = self.get_tenant()
|
||||
try:
|
||||
self.settings_dict["NAME"] = self.get_tenant()
|
||||
return super().get_connection_params()
|
||||
finally:
|
||||
del self.settings_dict["NAME"]
|
||||
self.settings_dict.pop("NAME", None)
|
||||
|
||||
def is_in_memory_db(self):
|
||||
return False # we _know_ we don't do multi-tenant in memory, so this is simpler than some lookup.
|
||||
|
||||
@@ -4,6 +4,7 @@ from django.utils.autoreload import autoreload_started
|
||||
|
||||
|
||||
def watch_for_debugserver_reload(sender, **kwargs):
|
||||
return
|
||||
from .management.commands.make_consistent import make_consistent
|
||||
make_consistent()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user