mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
Add django-upgrade to pre-commit-config.yaml (#411)
This commit is contained in:
parent
830152f0f4
commit
eb5e873082
2 changed files with 8 additions and 3 deletions
|
|
@ -21,4 +21,9 @@ repos:
|
|||
rev: v2.37.3
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py37-plus]
|
||||
args: [--py37-plus]
|
||||
- repo: https://github.com/adamchainz/django-upgrade
|
||||
rev: 1.7.0
|
||||
hooks:
|
||||
- id: django-upgrade
|
||||
args: [--target-version, "3.2"]
|
||||
|
|
@ -14,9 +14,9 @@ class AuditlogMiddleware:
|
|||
|
||||
def __call__(self, request):
|
||||
|
||||
if request.META.get("HTTP_X_FORWARDED_FOR"):
|
||||
if request.headers.get("X-Forwarded-For"):
|
||||
# In case of proxy, set 'original' address
|
||||
remote_addr = request.META.get("HTTP_X_FORWARDED_FOR").split(",")[0]
|
||||
remote_addr = request.headers.get("X-Forwarded-For").split(",")[0]
|
||||
else:
|
||||
remote_addr = request.META.get("REMOTE_ADDR")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue