From: Magnus Hagander Date: Mon, 18 Aug 2025 10:24:58 +0000 (+0200) Subject: Add "transfer registration" button to dashboard view X-Git-Url: http://git.postgresql.org/gitweb/edit?a=commitdiff_plain;h=5e43b0a5924c5e956eff17770c5782fa613c5c62;p=pgeu-system.git Add "transfer registration" button to dashboard view Previously one had to go to the specific transfer page to initiate the transfer, but adding this as an option directly from an existnig registration makes it easier since that's usually where the user starts the flow. --- diff --git a/postgresqleu/confreg/views.py b/postgresqleu/confreg/views.py index ff47bd78..4c7b7a9f 100644 --- a/postgresqleu/confreg/views.py +++ b/postgresqleu/confreg/views.py @@ -4536,8 +4536,16 @@ def transfer_reg(request, urlname): steps = None stephash = None + + if request.method == 'GET' and 'fromid' in request.GET: + initial = { + 'transfer_from': get_int_or_error(request.GET, 'fromid'), + } + else: + initial = {} + if request.method == 'POST': - form = TransferRegForm(conference, data=request.POST) + form = TransferRegForm(conference, data=request.POST, initial=initial) if form.is_valid(): savepoint = transaction.savepoint() @@ -4631,7 +4639,7 @@ def transfer_reg(request, urlname): # Fall through! else: - form = TransferRegForm(conference) + form = TransferRegForm(conference, initial=initial) return render(request, 'confreg/admin_transfer.html', { 'conference': conference, diff --git a/template/confreg/admin_registration_single.html b/template/confreg/admin_registration_single.html index 2ebf9161..87e11fc0 100644 --- a/template/confreg/admin_registration_single.html +++ b/template/confreg/admin_registration_single.html @@ -316,6 +316,9 @@ {%if reg.regtype and reg.can_edit and not reg.payconfirmedat %} Confirm registration {%endif%} +{%if reg.payconfirmedat and not reg.canceledat %} +Transfer registration +{%endif%} {%if conference.tickets%} Preview ticket {%endif%}