Skip to content

Commit

Permalink
[UPDT] HORILLA: Updated horilla global varriable APPS by declare them…
Browse files Browse the repository at this point in the history
… in every app ready() function
  • Loading branch information
horilla-opensource committed Jan 31, 2025
1 parent cc45e33 commit c03cafd
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 13 deletions.
2 changes: 2 additions & 0 deletions asset/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ class AssetConfig(AppConfig):
def ready(self):
from django.urls import include, path

from horilla.horilla_settings import APPS
from horilla.urls import urlpatterns

APPS.append("asset")
urlpatterns.append(
path("asset/", include("asset.urls")),
)
Expand Down
2 changes: 2 additions & 0 deletions attendance/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ class AttendanceConfig(AppConfig):
def ready(self):
from django.urls import include, path

from horilla.horilla_settings import APPS
from horilla.settings import MIDDLEWARE
from horilla.urls import urlpatterns

APPS.append("attendance")
urlpatterns.append(
path("attendance/", include("attendance.urls")),
)
Expand Down
10 changes: 7 additions & 3 deletions dynamic_fields/apps.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import logging
import sys

from django.apps import AppConfig
from django.db import connection
from django.core.management import call_command
from django.db import connection

from dynamic_fields.methods import column_exists

logger = logging.getLogger(__name__)
Expand All @@ -17,10 +19,11 @@ class DynamicFieldsConfig(AppConfig):
name = "dynamic_fields"

def ready(self):
from dynamic_fields.models import DynamicField
from django.contrib.contenttypes.models import ContentType
from simple_history.models import HistoricalRecords

from dynamic_fields.models import DynamicField

try:
dynamic_objects = DynamicField.objects.filter()
# Ensure this logic only runs when the server is started (and only once)
Expand Down Expand Up @@ -52,8 +55,9 @@ def ready(self):
logger.error(e)
logger.info("ignore if it is fresh installation")

from django.urls import include, path

from base.urls import urlpatterns
from django.urls import path, include

urlpatterns.append(
path("df/", include("dynamic_fields.urls")),
Expand Down
2 changes: 2 additions & 0 deletions helpdesk/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class HelpdeskConfig(AppConfig):
def ready(self):
from django.urls import include, path

from horilla.horilla_settings import APPS
from horilla.urls import urlpatterns

APPS.append("helpdesk")
urlpatterns.append(
path("helpdesk/", include("helpdesk.urls")),
)
Expand Down
20 changes: 10 additions & 10 deletions horilla/horilla_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@
]

APPS = [
"auth",
"base",
"recruitment",
"employee",
"leave",
"pms",
"onboarding",
"asset",
"attendance",
"payroll",
"auth",
"offboarding",
"accessibility",
"dynamic_fields",
"horilla_audit",
"horilla_views",
"horilla_backup",
"horilla_crumbs",
"horilla_widgets",
"horilla_documents",
"helpdesk",
"horilla_automations",
"notifications",
]

NO_PERMISSION_MODALS = [
Expand Down
2 changes: 2 additions & 0 deletions leave/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class LeaveConfig(AppConfig):
def ready(self):
from django.urls import include, path

from horilla.horilla_settings import APPS
from horilla.urls import urlpatterns

APPS.append("leave")
urlpatterns.append(
path("leave/", include("leave.urls")),
)
Expand Down
2 changes: 2 additions & 0 deletions offboarding/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class OffboardingConfig(AppConfig):
def ready(self):
from django.urls import include, path

from horilla.horilla_settings import APPS
from horilla.urls import urlpatterns

APPS.append("offboarding")
urlpatterns.append(
path("offboarding/", include("offboarding.urls")),
)
Expand Down
2 changes: 2 additions & 0 deletions onboarding/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class OnboardingConfig(AppConfig):
def ready(self):
from django.urls import include, path

from horilla.horilla_settings import APPS
from horilla.urls import urlpatterns

APPS.append("onboarding")
urlpatterns.append(
path("onboarding/", include("onboarding.urls")),
)
Expand Down
2 changes: 2 additions & 0 deletions payroll/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ def ready(self) -> None:
ready = super().ready()
from django.urls import include, path

from horilla.horilla_settings import APPS
from horilla.urls import urlpatterns

APPS.append("payroll")
urlpatterns.append(
path("payroll/", include("payroll.urls.urls")),
)
Expand Down
2 changes: 2 additions & 0 deletions pms/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ class PmsConfig(AppConfig):
def ready(self):
from django.urls import include, path

from horilla.horilla_settings import APPS
from horilla.urls import urlpatterns

APPS.append("pms")
urlpatterns.append(
path("pms/", include("pms.urls")),
)
Expand Down
2 changes: 2 additions & 0 deletions recruitment/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ class RecruitmentConfig(AppConfig):
def ready(self):
from django.urls import include, path

from horilla.horilla_settings import APPS
from horilla.urls import urlpatterns

APPS.append("recruitment")
urlpatterns.append(
path("recruitment/", include("recruitment.urls")),
)
Expand Down

0 comments on commit c03cafd

Please sign in to comment.