Fix email confirm hash in templates

This commit is contained in:
Raphael Michel
2024-10-07 17:54:40 +02:00
parent 6cc9529d9a
commit 61b25acdd2
2 changed files with 7 additions and 1 deletions

View File

@@ -40,6 +40,7 @@ import json
import logging
import operator
import string
import warnings
from collections import Counter
from datetime import datetime, time, timedelta
from decimal import Decimal
@@ -384,6 +385,11 @@ class Order(LockModel, LoggedModel):
def email_confirm_secret(self):
return self.tagged_secret("email_confirm", 9)
def email_confirm_hash(self):
warnings.warn('Use email_confirm_secret() instead of email_confirm_hash().',
DeprecationWarning)
return self.email_confirm_secret()
def check_email_confirm_secret(self, received_secret):
return (
hmac.compare_digest(

View File

@@ -143,7 +143,7 @@
</tr>
</table>
<div class="order-button">
<a href="{% abseventurl event "presale:event.order.open" hash=order.email_confirm_hash order=order.code secret=order.secret %}" class="button">
<a href="{% abseventurl event "presale:event.order.open" hash=order.email_confirm_secret order=order.code secret=order.secret %}" class="button">
{% trans "View order details" %}
</a>
</div>