From 0faf2452909176ba9daf1dc67fb584eb0383ff71 Mon Sep 17 00:00:00 2001 From: Martin Gross Date: Mon, 4 Jul 2022 16:51:52 +0200 Subject: [PATCH] PPv2: Default pretix_paypal_token_hash_cycle to 1 and not 0 --- src/pretix/plugins/paypal2/client/core/paypal_http_client.py | 2 +- src/pretix/plugins/paypal2/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pretix/plugins/paypal2/client/core/paypal_http_client.py b/src/pretix/plugins/paypal2/client/core/paypal_http_client.py index b4812203c7..4552d9b5fc 100644 --- a/src/pretix/plugins/paypal2/client/core/paypal_http_client.py +++ b/src/pretix/plugins/paypal2/client/core/paypal_http_client.py @@ -32,7 +32,7 @@ class PayPalHttpClient(VendorPayPalHttpClient): # Cached access tokens are not updated by PayPal to include new Merchants that granted access rights since # the access token was generated. Therefor we increment the cycle count and by that invalidate the cached # token and pull a new one. - incr = cache.get('pretix_paypal_token_hash_cycle', default=0) + incr = cache.get('pretix_paypal_token_hash_cycle', default=1) # Then we get all the items that make up the current credentials and create a hash to detect changes checksum = hashlib.sha256(''.join([ diff --git a/src/pretix/plugins/paypal2/views.py b/src/pretix/plugins/paypal2/views.py index 0f4bbd72d8..7721582d59 100644 --- a/src/pretix/plugins/paypal2/views.py +++ b/src/pretix/plugins/paypal2/views.py @@ -211,7 +211,7 @@ def isu_return(request, *args, **kwargs): try: cache.incr('pretix_paypal_token_hash_cycle') except ValueError: - cache.set('pretix_paypal_token_hash_cycle', 0) + cache.set('pretix_paypal_token_hash_cycle', 1) gs = GlobalSettingsObject() prov = Paypal(event)