mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-08 20:10:17 +02:00
[ADD] Check for ESI_USER_CONTACT_EMAIL
This commit is contained in:
parent
02214b74d0
commit
28cb62f373
@ -16,19 +16,40 @@ B = Configuration
|
||||
|
||||
@register()
|
||||
def django_settings(app_configs, **kwargs) -> List[CheckMessage]:
|
||||
"""
|
||||
Check that Django settings are correctly configured
|
||||
|
||||
:param app_configs:
|
||||
:type app_configs:
|
||||
:param kwargs:
|
||||
:type kwargs:
|
||||
:return:
|
||||
:rtype:
|
||||
"""
|
||||
|
||||
errors: List[CheckMessage] = []
|
||||
|
||||
# SITE_URL
|
||||
if hasattr(settings, "SITE_URL"):
|
||||
if settings.SITE_URL[-1] == "/":
|
||||
errors.append(Warning("'SITE_URL' Has a trailing slash. This may lead to incorrect links being generated by Auth.", hint="", id="allianceauth.checks.B005"))
|
||||
else:
|
||||
errors.append(Error("No 'SITE_URL' found is settings. This may lead to incorrect links being generated by Auth or Errors in 3rd party modules.", hint="", id="allianceauth.checks.B006"))
|
||||
|
||||
# CSRF_TRUSTED_ORIGINS
|
||||
if hasattr(settings, "CSRF_TRUSTED_ORIGINS") and hasattr(settings, "SITE_URL"):
|
||||
if settings.SITE_URL not in settings.CSRF_TRUSTED_ORIGINS:
|
||||
errors.append(Warning("'SITE_URL' not found in 'CSRF_TRUSTED_ORIGINS'. Auth may not load pages correctly until this is rectified.", hint="", id="allianceauth.checks.B007"))
|
||||
else:
|
||||
errors.append(Error("No 'CSRF_TRUSTED_ORIGINS' found is settings, Auth may not load pages correctly until this is rectified", hint="", id="allianceauth.checks.B008"))
|
||||
|
||||
# ESI_USER_CONTACT_EMAIL
|
||||
if hasattr(settings, "ESI_USER_CONTACT_EMAIL"):
|
||||
if settings.ESI_USER_CONTACT_EMAIL == "":
|
||||
errors.append(Error("'ESI_USER_CONTACT_EMAIL' is empty. A valid email is required as maintainer contact for CCP.", hint="", id="allianceauth.checks.B009"))
|
||||
else:
|
||||
errors.append(Error("No 'ESI_USER_CONTACT_EMAIL' found is settings. A valid email is required as maintainer contact for CCP.", hint="", id="allianceauth.checks.B010"))
|
||||
|
||||
return errors
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user