|
|
@ -23,10 +23,11 @@ from unfold.sites import UnfoldAdminSite |
|
|
def is_dovoodi_panel(request): |
|
|
def is_dovoodi_panel(request): |
|
|
""" |
|
|
""" |
|
|
Returns True if the user is accessing the Dovoodi admin panel. |
|
|
Returns True if the user is accessing the Dovoodi admin panel. |
|
|
Checks if '/dovoodi/' exists anywhere in the path to handle i18n prefixes |
|
|
|
|
|
(e.g., /en/dovoodi/admin, /fa/dovoodi/admin). |
|
|
|
|
|
|
|
|
Checks if 'dovodi' or 'dovoodi' is in the host domain, or if '/dovoodi/' |
|
|
|
|
|
exists anywhere in the path. |
|
|
""" |
|
|
""" |
|
|
return '/dovoodi/' in request.path |
|
|
|
|
|
|
|
|
host = request.get_host() |
|
|
|
|
|
return 'dovodi' in host or 'dovoodi' in host or '/dovoodi/' in request.path |
|
|
|
|
|
|
|
|
def is_main_panel(request): |
|
|
def is_main_panel(request): |
|
|
"""Returns True if the user is accessing the Main (Imam Javad) admin panel.""" |
|
|
"""Returns True if the user is accessing the Main (Imam Javad) admin panel.""" |
|
|
|