diff --git a/src/pretix/plugins/paypal2/views.py b/src/pretix/plugins/paypal2/views.py index b9f825db46..b96005121a 100644 --- a/src/pretix/plugins/paypal2/views.py +++ b/src/pretix/plugins/paypal2/views.py @@ -205,7 +205,10 @@ def isu_return(request, *args, **kwargs): # 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. - cache.incr('pretix_paypal_token_hash_cycle') + try: + cache.incr('pretix_paypal_token_hash_cycle') + except ValueError: + cache.set('pretix_paypal_token_hash_cycle', 0) gs = GlobalSettingsObject() prov = Paypal(event)