summaryrefslogtreecommitdiff
path: root/postgresqleu
diff options
context:
space:
mode:
authorMagnus Hagander2019-10-29 14:22:15 +0000
committerMagnus Hagander2019-10-29 14:22:15 +0000
commit5f6b5c992233b472fab9900b5d13bfbc81d3664c (patch)
treed6b6e185412f80b0c9a8e8c4f088d16e8e85a41c /postgresqleu
parent6d30d8c4a973546fd709e3c2b2911d5bd2729271 (diff)
Don't force sponosrship contract pdf to both exist and not
At some point the system started enforcing that a sponsorship contract both had to be uploade din the first save, and also could not be uploaded until it had been saved once, making it only possible to change contracts and not create new ones. This is an ugly fix removing half that check. It still requires a contract to be created without a pdf and then edited to add the pdf. It shuld be rewritten to use a better way of storage so this is not required (we have other examples of that), but it works as a quick-fix.
Diffstat (limited to 'postgresqleu')
-rw-r--r--postgresqleu/confsponsor/backendforms.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/postgresqleu/confsponsor/backendforms.py b/postgresqleu/confsponsor/backendforms.py
index 663c6722..4e371235 100644
--- a/postgresqleu/confsponsor/backendforms.py
+++ b/postgresqleu/confsponsor/backendforms.py
@@ -214,7 +214,10 @@ class BackendSponsorshipContractForm(BackendForm):
# No file included in this upload, but it existed before. So
# just leave untouched.
return None
- return "Contract must be uploaded"
+ if self.instance.pk:
+ return "Contract must be uploaded"
+ else:
+ return None
mtype = magicdb.buffer(f.read())
if not mtype.startswith('application/pdf'):
return "Contracts must be uploaded in PDF format, not %s" % mtype