all(minor): replace django-ipware with custom implementation

This commit is contained in:
Jens Langhammer
2019-12-05 14:33:55 +01:00
parent 328c999cb9
commit b08ec0477e
7 changed files with 226 additions and 219 deletions

View File

@ -5,10 +5,10 @@ from django.contrib.postgres.fields import JSONField
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import gettext as _
from ipware import get_client_ip
from structlog import get_logger
from passbook.lib.models import UUIDModel
from passbook.lib.utils.http import get_client_ip
LOGGER = get_logger()
@ -47,7 +47,7 @@ class Event(UUIDModel):
@staticmethod
def create(action, request, **kwargs):
"""Create Event from arguments"""
client_ip, _ = get_client_ip(request)
client_ip = get_client_ip(request)
if not hasattr(request, 'user'):
user = None
else: