Skip to content

Commit 2d4eae9

Browse files
committed
Add support for sponsors requesting explicit contract at click-through levels
Click-through contracts makes it easier for most, but some sponsor organisations require an actual contract at these levels as well. To handle this, add an option during contract/address verification to request an explicit contract, which can then be either manual or digital, and will both prevent the clickthrough contract and invoice to be sent until thsi contract has been completed.
1 parent c7dfd89 commit 2d4eae9

File tree

9 files changed

+49
-13
lines changed

9 files changed

+49
-13
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.11 on 2025-06-03 13:17
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('confsponsor', '0034_rename_instantbuy'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='sponsor',
15+
name='explicitcontract',
16+
field=models.BooleanField(default=False, verbose_name='Requested explicit contract'),
17+
),
18+
]

postgresqleu/confsponsor/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ class Sponsor(models.Model):
166166
signmethod = models.IntegerField(null=False, blank=False, default=1, choices=((0, 'Digital signatures'), (1, 'Manual signatures')), verbose_name='Signing method')
167167
autoapprovesigned = models.BooleanField(null=False, blank=False, default=True, verbose_name="Approve on signing", help_text="Automatically approve once digital signatures are completed")
168168
contract = models.OneToOneField(DigisignDocument, null=True, blank=True, help_text="Contract, when using digital signatures", on_delete=models.SET_NULL)
169+
explicitcontract = models.BooleanField(null=False, blank=False, default=False, verbose_name='Requested explicit contract')
169170

170171
def __str__(self):
171172
return self.name

postgresqleu/confsponsor/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def get_pdf_fields_for_conference(conference, sponsor=None, overrides={}):
175175
fields.append(
176176
('static:euvat', sponsor.vatnumber if sponsor else overrides.get('static:euvat', 'Sponsor EU VAT number')),
177177
)
178-
if sponsor and sponsor.level.contractlevel == 1:
178+
if sponsor and sponsor.level.contractlevel == 1 and not sponsor.explicitcontract:
179179
# Only add clickthrough contract fields if it's a clickthrough level (or a preview, with no sponsor yet)
180180
fields.extend([
181181
('static:clickthrough', overrides.get('static:clickthrough', 'Click-through agreement')),

postgresqleu/confsponsor/views.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def _generate_and_send_sponsor_contract(sponsor):
389389
send_sponsor_manager_email(
390390
sponsor,
391391
'Your contract for {}'.format(conference.conferencename),
392-
'confsponsor/mail/{}.txt'.format('sponsor_contract_instant' if level.contractlevel == 1 else 'sponsor_contract_manual'),
392+
'confsponsor/mail/{}.txt'.format('sponsor_contract_instant' if (level.contractlevel == 1 and not sponsor.explicitcontract) else 'sponsor_contract_manual'),
393393
{
394394
'conference': conference,
395395
'sponsor': sponsor,
@@ -455,7 +455,7 @@ def sponsor_signup(request, confurlname, levelurlname):
455455
# Stage 2 = contract choice. When submitted, sign up.
456456
# If there is no contract needed on this level, or there is no choice
457457
# of contract because only one available, we bypass stage 1.
458-
if stage == '1' and (level.contractlevel != 2 or not conference.contractprovider or not conference.manualcontracts):
458+
if stage == '1' and ((level.contractlevel != 2 and request.POST.get('explicitcontract', '') != '1') or not conference.contractprovider or not conference.manualcontracts):
459459
stage = '2'
460460

461461
def _render_contract_choices():
@@ -480,6 +480,7 @@ def _render_contract_choices():
480480
'form': form,
481481
'noform': 1,
482482
'contractchoices': contractchoices,
483+
'explicitcontract': request.POST.get('explicitcontract', '') == '1',
483484
})
484485

485486
if stage == '0':
@@ -507,7 +508,7 @@ def _render_contract_choices():
507508
# If the Continue editing button is selected we should go back
508509
# to just rendering the normal form. Otherwise, go ahead and create the record.
509510
if request.POST.get('submit', '') != 'Continue editing':
510-
if request.POST.get('contractchoice', '') not in ('0', '1') and level.contractlevel == 2:
511+
if request.POST.get('contractchoice', '') not in ('0', '1') and (level.contractlevel == 2 or request.POST.get('explicitcontract', '') == '1'):
511512
return _render_contract_choices()
512513

513514
social = {
@@ -525,8 +526,9 @@ def _render_contract_choices():
525526
level=level,
526527
social=social,
527528
invoiceaddr=form.cleaned_data['address'],
528-
signmethod=1 if request.POST.get('contractchoice', '') == '1' or not conference.contractprovider or level.contractlevel < 2 else 0,
529+
signmethod=1 if request.POST.get('contractchoice', '') == '1' or not conference.contractprovider or level.contractlevel < 2 or request.POST.get('explicitcontract', '') == '1' else 0,
529530
autoapprovesigned=conference.autocontracts,
531+
explicitcontract=request.POST.get('explicitcontract', '') == '1',
530532
)
531533
if settings.EU_VAT:
532534
sponsor.vatstatus = int(form.cleaned_data['vatstatus'])
@@ -539,7 +541,7 @@ def _render_contract_choices():
539541

540542
error = None
541543

542-
if level.contractlevel < 2:
544+
if level.contractlevel < 2 and request.POST.get('explicitcontract', '') != '1':
543545
# No contract or click-through contract
544546
if level.contractlevel == 1:
545547
# Click-through contract
@@ -548,6 +550,7 @@ def _render_contract_choices():
548550
mailstr += "Level does not require a signed contract. Verify the details and approve\nthe sponsorship using:\n\n{0}/events/sponsor/admin/{1}/{2}/".format(
549551
settings.SITEBASE, conference.urlname, sponsor.id)
550552
else:
553+
# Contract required!
551554
contractid, error = _generate_and_send_sponsor_contract(sponsor)
552555

553556
if sponsor.signmethod == 1:

template/confsponsor/admin_dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ <h2>Unconfirmed sponsors</h2>
8888
{%else%}
8989
<span class="label label-success">Invoiced</span>
9090
{%endif%}
91-
{%elif s.level.contractlevel < 2 %}
91+
{%elif s.level.contractlevel < 2 and not s.explicitcontract %}
9292
<span class="label label-warning" title="Sponsor details for {%if s.level.contractlevel == 1 %}click-through{%else%}no{%endif%} contract levels have to be verified before invoice is issued">Pending organizer verification</span>
9393
{%else%}
9494
{%if s.signmethod == 0 and s.contract %}

template/confsponsor/admin_sponsor.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ <h4>Send new contract</h4>
140140
<p>
141141
This sponsorship is awaiting an <a href="/invoiceadmin/{{sponsor.invoice.pk}}/">invoice</a> to be paid.
142142
</p>
143-
{%if sponsor.level.contractlevel == 2 %}
143+
{%if sponsor.level.contractlevel == 2 or sponsor.explicitcontract %}
144144
{%comment%}Only full contract sponsorships should be manually confirmed{%endcomment%}
145145
<p>
146146
<b>Iff</b> there is a signed <i>and</i> countersigned contract available
@@ -161,7 +161,7 @@ <h4>Send new contract</h4>
161161
{%else%}
162162
{%comment%}Sponsor has no invoice{%endcomment%}
163163
{%if sponsor.level.levelcost %}
164-
{%if sponsor.level.contractlevel < 2%}
164+
{%if sponsor.level.contractlevel < 2 and not sponsor.explicitcontract %}
165165
<p>
166166
This sponsorship has not yet been issued an invoice. This is a
167167
{%if sponsor.level.contractlevel == 1 %}click-through{%else%}no{%endif%}
@@ -192,7 +192,7 @@ <h4>Send new contract</h4>
192192
has been received, go ahead and generate the invoice.
193193
</p>
194194
{%endif%}{%comment%}Digital contracts{%endcomment%}
195-
{%endif%}{%comment%}contractlevel < 2{%endcomment%}
195+
{%endif%}{%comment%}contractlevel < 2 and not explicitcontract{%endcomment%}
196196
{%else%}{%comment%}levelcost != 0 {%endcomment%}
197197
<p>
198198
This sponsorship has zero cost, which means payment is handled manually.

template/confsponsor/admin_sponsor_details.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<td>
4242
{%if sponsor.level.contractlevel == 0 %}
4343
No contract needed for this level.
44-
{%elif sponsor.level.contractlevel == 1 %}
44+
{%elif sponsor.level.contractlevel == 1 and not sponsor.explicitcontract %}
4545
Click-through contract completed. {%if not sponsor.confirmed%}<form class="inline-block-form" method="post" action="resendcontract/">{% csrf_token %}<input type="submit" class="btn btn-sm btn-default confirm-btn" value="Re-send contract anyway" data-confirm="Are you sure you want to re-send a new contract to this sponsor?{%if sponsor.signmethod == 0%} {{conference.contractprovider.implementation.resendprompt}}{%endif%}"></form>{%endif%}
4646
{%else%}{%comment%}Full contract{%endcomment%}
4747
{%if sponsor.signmethod == 0%}

template/confsponsor/signupform.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ <h4>Contract details</h4>
6565
step. If anything about it is incorrect please click <i>Continue
6666
editing</i> and correct it <i>before</i> proceeding.
6767
</p>
68+
69+
{% if level.contractlevel == 1 %}
70+
<h4>Contract options</h4>
71+
<p>
72+
As this level uses a click-thruogh contract, no specific contract signature is
73+
required. However, if your organization requires a signed contract, you can
74+
explicitly request one here.
75+
</p>
76+
<p>
77+
<input type="checkbox" name="explicitcontract" value="1"> Request explicit contract
78+
</p>
79+
{% endif %}
80+
6881
{%endif%}
6982

7083
<h4>Invoice address preview</h4>
@@ -97,6 +110,7 @@ <h4>Contract signing</h4>
97110
</dl>
98111

99112
<input type="hidden" name="stage" value="2">
113+
{%if explicitcontract %}<input type="hidden" name="explicitcontract" value="1">{%endif%}
100114
{%endif%}{# contractchoices #}
101115

102116
{%if level.contractlevle == 2 and not noform %}

template/confsponsor/sponsor.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h1>Conference Sponsorship - {{sponsor.conference}}</h1>
4040
<td>
4141
{% if sponsor.level.contractlevel == 0 %}
4242
This level requires no contract.
43-
{% elif sponsor.level.contractlevel == 1 %}
43+
{% elif sponsor.level.contractlevel == 1 and not sponsor.explicitcontract %}
4444
Click-through contract agreed to. <a href="contractview/" class="btn btn-outline-dark btn-sm">View copy of contract</a>
4545
{% else %}
4646
{%if sponsor.signmethod == 0%}
@@ -75,7 +75,7 @@ <h1>Conference Sponsorship - {{sponsor.conference}}</h1>
7575
{%endwith%}
7676
{%else%}
7777
{%comment%}No invoice generated{%endcomment%}
78-
{%if sponsor.level.contractlevel < 2 %}
78+
{%if sponsor.level.contractlevel < 2 and not sponsor.explicitcontract %}
7979
{%comment%}No invoice generated but clickthrough contract or no contract, so awaiting admin approval{%endcomment%}
8080
<p>
8181
Your sponsorship request has been submitted, and is currently awaiting confirmation

0 commit comments

Comments
 (0)