add payment_link and banks
This commit is contained in:
1 parent
2ae79b1ca4
commit
de3135b588
100 files changed
+6167
-47
No files matched your search
@@ -1,4 +1,5 @@
|
||||
from django.utils import timezone
|
||||
from apps.core.session_access import grant_scoped_session_access
|
||||
|
||||
from .models import TicketMagicLink
|
||||
|
||||
@@ -8,10 +9,7 @@ MAGIC_LINK_SESSION_KEY = "ticket_magic_link_id"
|
||||
|
||||
def grant_ticket_magic_access(request, link):
|
||||
"""Grant an anonymous session access to exactly one ticket until link expiry."""
|
||||
request.session.cycle_key()
|
||||
request.session[MAGIC_LINK_SESSION_KEY] = link.pk
|
||||
remaining = max(1, int((link.expires_at - timezone.now()).total_seconds()))
|
||||
request.session.set_expiry(remaining)
|
||||
grant_scoped_session_access(request, MAGIC_LINK_SESSION_KEY, link.pk, link.expires_at)
|
||||
|
||||
|
||||
def get_ticket_magic_access(request, ticket=None):
|
||||
|
||||
Reference in new issue
Block a user