Skip to content
Snippets Groups Projects
Commit a77d523c authored by Julian's avatar Julian
Browse files

Fix internal ip validation fro maintenace mode

parent eeeb36ac
No related branches found
No related tags found
1 merge request!1154Resolve "Verify maintenance mode with GraphQL / reimplement maintenance mode handling"
......@@ -696,7 +696,7 @@ MAINTENANCE_MODE = _settings.get("maintenance.enabled", None)
MAINTENANCE_MODE_IGNORE_IP_ADDRESSES = _settings.get(
"maintenance.ignore_ips", _settings.get("maintenance.internal_ips", [])
)
MAINTENANCE_MODE_GET_CLIENT_IP_ADDRESS = "ipware.ip.get_ip"
MAINTENANCE_MODE_GET_CLIENT_IP_ADDRESS = "aleksis.core.util.core_helpers.get_ip"
MAINTENANCE_MODE_IGNORE_SUPERUSER = True
MAINTENANCE_MODE_STATE_FILE_NAME = _settings.get(
"maintenance.statefile", "maintenance_mode_state.txt"
......
......@@ -482,3 +482,10 @@ class OOTRouter:
post_invalidation.connect(OOTRouter._invalidate_cachalot)
def get_ip(*args, **kwargs):
"""Recreate ipware.ip.get_ip as it was replaced by get_client_ip."""
from ipware.ip import get_client_ip # noqa
return get_client_ip(*args, **kwargs)[0]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment