Previously we could only cancel a registration once it was confirmed.
But given the new system to "register for somebody else", it seems to be
more common to have to remove one that has *not* been confirmed,
particularly when it has been created by somebody other than the actual
attendee.
@property
def can_edit(self):
+ # Can this registration be edited by the end user (which also implies
+ # it can be deleted)
return not (self.payconfirmedat or self.invoice or self.bulkpayment)
def short_regtype(self):
)
-def cancel_registration(reg):
+def cancel_registration(reg, is_unconfirmed=False):
# Verify that we're only canceling a real registration
if not reg.payconfirmedat:
- raise Exception("Registration not paid, data is out of sync!")
+ # If we don't allow canceling an unpaid registration, and the registration
+ # actually is unpaid, then boom.
+ if not is_unconfirmed:
+ raise Exception("Registration not paid, data is out of sync!")
# If we sent a welcome mail, also send a goodbye mail
if reg.conference.sendwelcomemail:
{
'conference': reg.conference,
'reg': reg,
+ 'unconfirmed': is_unconfirmed,
},
sendername=reg.conference.conferencename,
receivername=reg.fullname,
if request.method == 'POST' and request.POST.get('docancel') == '1':
name = reg.fullname
- cancel_registration(reg)
+ is_unconfirmed = (reg.payconfirmedat is None)
+ cancel_registration(reg, is_unconfirmed)
return render(request, 'confreg/admin_registration_cancel_confirm.html', {
'conference': conference,
'name': name,
so you will <i>also</i> need to manually cancel thre reservation in question.
</p>
<a class="btn btn-default btn-block" href="/invoiceadmin/{{reg.bulkpayment.invoice.pk}}/refund/">Refund bulk invoice</a>
-{%else%}
+{%elif reg.payconfirmedat%}
<p>
This registration does not have an invoice or bulk payment. That means it was either
a no-pay registration (such as voucher) or a manually confirmed one (speaker, staff,
or fully manual).
</p>
+{%else%}
+<p>
+ This registration has not been finalized, and can be removed without refund.
+</p>
{%endif%}
<form method="post" action=".">{% csrf_token %}
<input type="hidden" name="docancel" value="1">
- <input type="submit" class="btn btn-default btn-block" value="Cancel registration without refund" onclick="return confirmit()">
+ <input type="submit" class="btn btn-default btn-block" value="{%if payconfirmedat%}Cancel registration without refund{%else%}Remove unconfirmed registration{%endif%}" onclick="return confirmit()">
</form>
+<p></p>
<a class="btn btn-default btn-block" href="/events/admin/{{conference.urlname}}/regdashboard/list/{{reg.id}}/">Back to registration</a>
{%if reg.payconfirmedat%}
<a class="btn btn-default btn-block" href="/events/admin/{{conference.urlname}}/regdashboard/list/{{reg.id}}/cancel/">Cancel registration</a>
{%endif%}
-
+{%if reg.can_edit %}
+<a class="btn btn-default btn-block" href="/events/admin/{{conference.urlname}}/regdashboard/list/{{reg.id}}/cancel/">Remove unconfirmed registration entry</a>
+{%endif%}
<a class="btn btn-default btn-block" href="/events/admin/{{conference.urlname}}/regdashboard/list/">Back to list</a>
{%endblock%}
-Your registration for {{conference.conferencename}} has been canceled.
+Your {%if unconfirmed%}unfinished {%endif%}registration for {{conference.conferencename}} has been {%if unconfirmed%}removed{%else%}canceled{%endif%}.
If you did not expect this or do not know why this happened,
please contact us ASAP by responding to this email, and we will
investigate the situation.
-Your registration has now been fully canceled, so you do not need
+{%if not unconfirmed%}Your registration has now been fully canceled, so you do not need
to do anything else to complete it. We hope to see you again at
a future event!
+{%endif%}