From 06bed44a6a8d934aec60a06010e4fe5d4a706b66 Mon Sep 17 00:00:00 2001 From: Harald Nezbeda Date: Wed, 29 Mar 2023 18:18:59 +0200 Subject: [PATCH] Fixes reading of custom settings --- drf_ip_restrictions/permissions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drf_ip_restrictions/permissions.py b/drf_ip_restrictions/permissions.py index 74fcc9f..a4654cf 100644 --- a/drf_ip_restrictions/permissions.py +++ b/drf_ip_restrictions/permissions.py @@ -14,7 +14,7 @@ def has_permission(self, request, view): if client_ip: settings = ip_restriction_settings() - allowed_ips = getattr(settings, self.setting_ip_list) + allowed_ips = settings.user_settings[self.setting_ip_list] for allowed_ip in allowed_ips: if client_ip == allowed_ip or client_ip.startswith(allowed_ip): return True