mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Upgrade to Django 2.2 and modern DRF and py.test (#1246)
* Upgrade django and stuff * Update to Django 2.2 and recent versions of similar packages * Provide explicit orderings to all models used in paginated queries * Resolve naive datetime warnings in test suite * Deal with deprecation warnings * Fix sqlparse version
This commit is contained in:
@@ -21,15 +21,15 @@ class IdempotencyMiddleware:
|
||||
if not request.path.startswith('/api/'):
|
||||
return self.get_response(request)
|
||||
|
||||
if not request.META.get('HTTP_X_IDEMPOTENCY_KEY'):
|
||||
if not request.headers.get('X-Idempotency-Key'):
|
||||
return self.get_response(request)
|
||||
|
||||
auth_hash_parts = '{}:{}'.format(
|
||||
request.META.get('HTTP_AUTHORIZATION', ''),
|
||||
request.headers.get('Authorization', ''),
|
||||
request.COOKIES.get(settings.SESSION_COOKIE_NAME, '')
|
||||
)
|
||||
auth_hash = sha1(auth_hash_parts.encode()).hexdigest()
|
||||
idempotency_key = request.META.get('HTTP_X_IDEMPOTENCY_KEY', '')
|
||||
idempotency_key = request.headers.get('X-Idempotency-Key', '')
|
||||
|
||||
with transaction.atomic():
|
||||
call, created = ApiCall.objects.select_for_update().get_or_create(
|
||||
|
||||
Reference in New Issue
Block a user