Skip to content

Commit

Permalink
Simplify creation of initial app settings
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack committed May 27, 2024
1 parent d813209 commit 7cd1eb8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions radis/collections/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ def init_db(**kwargs):
def create_app_settings():
from .models import CollectionsAppSettings

settings = CollectionsAppSettings.get()
if not settings:
if not CollectionsAppSettings.objects.exists():
CollectionsAppSettings.objects.create()
3 changes: 1 addition & 2 deletions radis/notes/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ def init_db(**kwargs):
def create_app_settings():
from .models import NotesAppSettings

settings = NotesAppSettings.get()
if not settings:
if not NotesAppSettings.objects.exists():
NotesAppSettings.objects.create()
3 changes: 1 addition & 2 deletions radis/rag/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ def init_db(**kwargs):
def create_app_settings():
from .models import RagAppSettings

settings = RagAppSettings.get()
if not settings:
if not RagAppSettings.objects.exists():
RagAppSettings.objects.create()
3 changes: 1 addition & 2 deletions radis/reports/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ def init_db(**kwargs):
def create_app_settings():
from .models import ReportsAppSettings

settings = ReportsAppSettings.get()
if not settings:
if not ReportsAppSettings.objects.exists():
ReportsAppSettings.objects.create()
3 changes: 1 addition & 2 deletions radis/search/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ def init_db(**kwargs):
def create_app_settings():
from .models import SearchAppSettings

settings = SearchAppSettings.get()
if not settings:
if not SearchAppSettings.objects.exists():
SearchAppSettings.objects.create()

0 comments on commit 7cd1eb8

Please sign in to comment.