FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
  1. Sep 20, 2023
    • Dr Catherine Pitt's avatar
      Don't put invalid post categories into database · ca11e397
      Dr Catherine Pitt authored
      When creating a form there is now a post category question, although
      it's only compulsory for visitor forms. However even if it is not filled
      because the question has a default value representing "no data" we ended
      up storing that value in the database, and the default value is an
      invalid post category for our database schema. This didn't seem to do
      any real harm (Hotwire simply displayed a blank) but was at best confusing when
      examining the underlying column data. This change checks for the default
      "no data" value and sets the database column null in that case instead.
      v67
      ca11e397
    • Dr Catherine Pitt's avatar
      Set visitor_type choices for bulk registration form · 54b3243c
      Dr Catherine Pitt authored
      This broke when the changes to form generation around visitor types
      were made - the bulk registration form needs to be passed the list of
      types of visitor in order to do validation. Otherwise validation always
      fails, even if not registering a visitor.
      54b3243c
  2. Sep 12, 2023
  3. Aug 29, 2023
  4. Aug 24, 2023
    • Dr Catherine Pitt's avatar
      Format form generation form template · 9f15ff7c
      Dr Catherine Pitt authored
      This template was becoming difficult to read so has now been indented.
      9f15ff7c
    • Dr Catherine Pitt's avatar
      Add visitor type question to form generation form · 710a0166
      Dr Catherine Pitt authored
      We want to have the person generating a form choose the type of visitor
      when generating a form for a visitor, because our starters often pick an
      incorrect type. This adds the question to the form and some styling to
      make the whole thing more readable.
      
      Nothing is done with the question data as yet, nor is there any checking
      that a type is selected when a visitor form is generated.
      710a0166
    • Dr Catherine Pitt's avatar
      Allow non-integer key for null value in hid choices · 665495f0
      Dr Catherine Pitt authored
      The database module has a get_hids() function that generates a list of
      2-element lists representing a list of foreign key values and their
      human-readable equivalents from the database. These are used to present
      select lists for post categories, nationalities and the like. Generally
      the keys are integers. The function has an option to add a "null" option
      to the list, for use in selects where input is optional. The value
      associated with that defaulted to the integer -1.
      
      This became a problem when I needed to add a select field with string
      keys (post category ids) and also having a null option, because the null
      option was coerced from an int to a string like the rest of the data, so
      always failed validation.  This change makes the value for the null
      option configurable but defaulting to -1.
      665495f0
    • Dr Catherine Pitt's avatar
      Tweak home address question wording for visitors · 97380268
      Dr Catherine Pitt authored
      We wanted the question about 'home address' to read 'Cambridge home
      address' in order to prevent visitors staying in Cambridge for the short
      term from putting their permanent home address down instead of where
      they are staying day to day, but for many non-visitor categories this
      makes no sense - it's possible to be staff living in Ely or Haverhill
      and working here.
      
      This change moves the special wording to only apply to visitor
      categories.
      97380268
    • Dr Catherine Pitt's avatar
      Define form class for embedded staff · 3bf1735d
      Dr Catherine Pitt authored
      b52c1067 defined the category of
      embedded company staff as being separate from visitors, but didn't
      implement the class providing the personal data form for them. This
      change fixes that.
      3bf1735d
    • Dr Catherine Pitt's avatar
      Improve form generation form · 02266199
      Dr Catherine Pitt authored
      Present 'visitor' category last, as it's the catchall. Better help text
      for embedded company staff.
      02266199
    • Dr Catherine Pitt's avatar
      2f12608d
    • Dr Catherine Pitt's avatar
      WIP: Splitting embedded company staff to have own form · b52c1067
      Dr Catherine Pitt authored
      Add separate form, w/o post cagetory or home institution questions.
      
      Need to supply database view registration.embedded_company_staff_hid .
      
      Need to update registration.visitor_hid to not include embedded company
      staff, and to include a Visitor (Other) category, but that be done after the
      separate form for embedded staff goes live. Need to check with Safety
      what training Other should do.
      
      None of this tested.
      b52c1067
    • Dr Catherine Pitt's avatar
      Merge branch 'visitor_home_institution_compulsory' into 'main' · c7af3b2c
      Dr Catherine Pitt authored
      Improvements to visitor form
      
      See merge request !7
      v64
      c7af3b2c
    • Dr Catherine Pitt's avatar
      Improvements to visitor form · de3d5136
      Dr Catherine Pitt authored
      Home institution question reworded and made compulsory - we need good
      answers to this for visa checks and too many people leave it blank.
      The rewording is necessary to help out people who aren't simply visiting
      from another university to know how to answer it.
      
      Home address question reworded to make it clearer it's the Cambridge
      address we need.
      
      RT 230000
      de3d5136
  5. Aug 08, 2023
    • Dr Catherine Pitt's avatar
      Supervisor question is more helpful · c2321abb
      Dr Catherine Pitt authored
      We've been getting cases lately where people have been putting down
      postdocs as their supervisor rather than the head of their group. This
      causes problems because when the person gets imported into the database
      they get no research group membership.
      
      This change expands the question to help people pick the right option.
      It also tweaks the CSS in order to make the longer question display
      nicely, because the overflow settings we need for Chosen fields cause
      the text to overhang onto the next question. Specifically we add clear:
      both to the div that encloses each whole question and split the padding
      evenly between the top and bottom rather than having it all at the
      bottom. Then the text overhangs but doesn't push the question below to
      the right, and we still get a bit of space before the next question.
      v63
      c2321abb
  6. Jun 26, 2023
    • Dr Catherine Pitt's avatar
      Add test for new get_form_type_default function · 9d3c12b4
      Dr Catherine Pitt authored
      Function added in 8ca86794 needs a test.
      v62
      9d3c12b4
    • Dr Catherine Pitt's avatar
      Rename a set of tests · 64f4e4ed
      Dr Catherine Pitt authored
      The name test_utils was too generic - this file only tested the utils.safety code.
      64f4e4ed
    • Dr Catherine Pitt's avatar
      Select a default form type dynamically for form generation · 8ca86794
      Dr Catherine Pitt authored
      This sets up the main form generation form to pick a default form type
      dynamically when rendering the form. If there is more than one form type
      available to the person generating the form no default is returned,
      forcing them to actively select one. But if they only have one type
      available to them that type is set as the default to save them a click.
      This was motivated by the need to allow embedded companies to generate
      registration forms for their staff, but they should only be allowed to
      generate 'visitor' forms. It therefore makes no sense to make them click
      to pick that option.
      8ca86794
    • Dr Catherine Pitt's avatar
      Improve text for Safety hdnbook missing error · f7478a12
      Dr Catherine Pitt authored
      The safety handbook being missing is normal in a test instance of the
      code, but the error message it produces makes it sound as if it's not.
      This change tweaks the error message to make it clearer that the missing
      handbook is a per-instance problem, and deploying the code as-is won't
      necessarily lead to a missing handbook in production
      f7478a12
    • Dr Catherine Pitt's avatar
      Update help text for visitor role selection · 89deb8bd
      Dr Catherine Pitt authored
      Previously all people allowed to generate registration forms were
      allowed to generate any type of form. We now need to allow embedded
      company employees who don't hold a parallel post in the Department of
      Chemistry to generate registration forms for their staff. Those people will
      always be classed as visitors to Chemistry, so we should only allow the
      generation of visitor forms. The code already implements this as it
      queries the database to find out what form types are available to the
      person generating forms and only offers those types. However the help
      text for visitor forms didn't make sense when visitor forms are the only
      option presented as it referred to 'previous' options. This alters it to
      work better as a standalone option.
      89deb8bd
  7. Jun 22, 2023
  8. May 19, 2023
  9. May 05, 2023
  10. May 03, 2023
  11. Apr 28, 2023
    • Dr Catherine Pitt's avatar
      Consolidate some database access functionality · d3ef380f
      Dr Catherine Pitt authored
      - adds a function in the database module to look up email addresses
      for currently registered people and uses it to simplify
      chemistry_starters.utils.mail_safety_induction_signoff
      
      - completely remove
      chemistry_starters.safety.get_safety_induction_signer as it can be done
      with database.get_form_column
      
      - update tests
      d3ef380f
    • Dr Catherine Pitt's avatar
      Email form creator when safety checklist submitted · 8573b7c5
      Dr Catherine Pitt authored
      Requested in RT 226948 where we were asked to inform the form creator
      when the personal details and safety checklist had both been completed.
      
      It seems unlikely that a single email at this point in the process is
      really all that is wanted, so this change adds a new function to send an
      email with a progress report to the form creator, and calls that when
      the safety form is submitted. If we're asked to send emails at other
      stages too we can just call that function again.
      
      It also adds a function to get the email address of a currentty
      registered person from their database id. This can be reused elsewhere.
      8573b7c5
Loading