diff --git a/apps/common/utils/common.py b/apps/common/utils/common.py index 063bd1ebc..add6b79b3 100644 --- a/apps/common/utils/common.py +++ b/apps/common/utils/common.py @@ -171,7 +171,7 @@ def get_request_ip(request): def get_request_ip_or_data(request): ip = '' - if hasattr(request, 'data') and request.data.get('remote_addr', ''): + if hasattr(request, 'data') and isinstance(request.data, dict) and request.data.get('remote_addr', ''): permission = ServiceAccountSignaturePermission() if permission.has_permission(request, None): ip = request.data.get('remote_addr', '')