billing/sponsorship: Allow blank organization URLs.

We ran into a bug in production caused by two issues:
- Some users came from orgs that didn't have a website and since
  the URL field was required, they submitted invalid URLs.
- We didn't properly respond to invalid form submissions, which
  led to UnboundLocalError exceptions in another part of the
  code.

This commit solves this by doing the following:
- We now allow blank URLs and have a convenient placeholder text
  label that tells users that they may leave the URL field blank.
- This commit refactors the code such that invalid form submissions
  result in an informative error message about what exactly went
  wrong.
This commit is contained in:
Eeshan Garg
2021-08-10 16:22:01 -02:30
committed by Tim Abbott
parent 6117c3824a
commit a808f02a22
5 changed files with 77 additions and 26 deletions

View File

@@ -238,7 +238,7 @@
<label>
<h4>Organization website</h4>
</label>
<input name="website" style="width: 100%;" type="text" class="input-large" required/>
<input name="website" style="width: 100%;" type="text" class="input-large" placeholder="{{ _('Leave blank if your organization does not have a website.') }}"/>
<label>
<h4>Describe your organization briefly</h4>
</label>