Skip to content

Commit

Permalink
Avoid to execute database queries in app ready method. #121
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed Feb 27, 2024
1 parent 54a744d commit c667299
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions extra_settings/apps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.apps import AppConfig
from django.conf import settings
from django.db.models.signals import post_migrate
from django.db.utils import OperationalError, ProgrammingError


class ExtraSettingsConfig(AppConfig):
Expand All @@ -13,9 +12,4 @@ def ready(self):
from extra_settings import signals # noqa: F401
from extra_settings.models import Setting

try:
Setting.set_defaults_from_settings()
except (OperationalError, ProgrammingError):
pass

post_migrate.connect(Setting.set_defaults_from_settings, sender=self)

0 comments on commit c667299

Please sign in to comment.