summaryrefslogtreecommitdiff
path: root/postgresqleu
diff options
context:
space:
mode:
authorMagnus Hagander2025-05-27 07:39:42 +0000
committerMagnus Hagander2025-05-27 07:39:42 +0000
commitde4e82c2d1cbe9cefdba36d0d05700af9e99f76c (patch)
tree908066abb0444fe5e843b967f59ccfc4e2d70ff3 /postgresqleu
parentb9d9a5f897c7e09acf645810d69dcc1af59a7ebd (diff)
Don't add click-though text to non-clickthrough contracts
If the clickthrough fields were added to a contract, we'd include the text even if the level wasn't clickthrough. This can happen when fields are copied between contracts, thereby ending up with clickthrough fields on non-clickthrough contracts.
Diffstat (limited to 'postgresqleu')
-rw-r--r--postgresqleu/confsponsor/util.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/postgresqleu/confsponsor/util.py b/postgresqleu/confsponsor/util.py
index f379e393..f9daeafa 100644
--- a/postgresqleu/confsponsor/util.py
+++ b/postgresqleu/confsponsor/util.py
@@ -175,9 +175,11 @@ def get_pdf_fields_for_conference(conference, sponsor=None, overrides={}):
fields.append(
('static:euvat', sponsor.vatnumber if sponsor else overrides.get('static:euvat', 'Sponsor EU VAT number')),
)
- fields.extend([
- ('static:clickthrough', overrides.get('static:clickthrough', 'Click-through agreement')),
- ('static:clickthroughdate', str(sponsor.signupat.date()) if sponsor else overrides.get('static:clickthroughdate', 'Click-through date')),
- ])
+ if sponsor and sponsor.level.contractlevel == 1:
+ # Only add clickthrough contract fields if it's a clickthrough level (or a preview, with no sponsor yet)
+ fields.extend([
+ ('static:clickthrough', overrides.get('static:clickthrough', 'Click-through agreement')),
+ ('static:clickthroughdate', str(sponsor.signupat.date()) if sponsor else overrides.get('static:clickthroughdate', 'Click-through date')),
+ ])
return fields