From c6fddf78ff2b8116d633a62f8ebd7c14f2eaa1ba Mon Sep 17 00:00:00 2001
From: Catherine Pitt <cen1001@cam.ac.uk>
Date: Tue, 29 Aug 2023 12:27:05 +0100
Subject: [PATCH] Remove post category question from visitor form

This is now set at form generation time.
---
 .../forms/person_role_data_forms.py           | 21 ++-----------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/chemistry_starters/forms/person_role_data_forms.py b/chemistry_starters/forms/person_role_data_forms.py
index 4575cc1..c776a23 100644
--- a/chemistry_starters/forms/person_role_data_forms.py
+++ b/chemistry_starters/forms/person_role_data_forms.py
@@ -345,34 +345,17 @@ class VisitorRegistrationForm(AllVisitorRegistrationForm):
     Form used for visitors
     """
 
-    post_category_id = ChosenSelectField(
-        "Category of visitor",
-        [validators.InputRequired()],
-        choices=[],
-        render_kw={"required": use_html_required_attr},
-    )
     home_institution = StrippedStringField("Home institution")
     already_has_university_card = university_card_box_factory()
     submitted = submit_box_factory()
 
-    def reload_hid_lists(self):
-        super(VisitorRegistrationForm, self).reload_hid_lists()
-        self.post_category_id.choices = database.get_hids(
-            [
-                roles[x]["post_choices_hid"]
-                for x in roles
-                if roles[x]["form_class"] == "VisitorRegistrationForm"
-            ][0],
-            null_option="",
-        )
-
 
 class ErasmusRegistrationForm(AllVisitorRegistrationForm):
     """
     Form used for Erasmus students
 
-    This is very similar to that for visitors, but they get a different choice
-    of categories. The separation is useful to work around the quirks
+    This is very similar to that for visitors, but they get a choice
+    of post categories. The separation is useful to work around the quirks
     in the database schema but could be removed.
     """
 
-- 
GitLab