Don’t ask for organisation type when we know it

Every time someone adds a new service we ask them what kind of
organisation they work for.

We can look this up based on the user’s email address now. So we should
only ask the question if:
- we don’t know about the organisation
- or we haven’t set what type of organisation it is (this shouldn’t be
  possible on productions because we’ve populated the column for all
  existing organisations and it’s impossible to add a new one without
  setting it
This commit is contained in:
Chris Hill-Scott
2019-04-18 12:44:18 +01:00
parent 156ae9931f
commit 08e9b35d7a
6 changed files with 71 additions and 15 deletions

View File

@@ -194,6 +194,7 @@ def organisation_json(
domains=None,
crown=True,
agreement_signed=False,
organisation_type='',
):
if users is None:
users = []
@@ -208,7 +209,7 @@ def organisation_json(
'created_at': created_at or str(datetime.utcnow()),
'email_branding_id': email_branding_id,
'letter_branding_id': letter_branding_id,
'organisation_type': '',
'organisation_type': organisation_type,
'crown': crown,
'agreement_signed': agreement_signed,
'agreement_signed_at': None,