david got a fish trophy!
Fix handling of the "mode" parameter to the SAML link user view.
Review Request #12921 — Created March 24, 2023 and submitted — Latest diff uploaded
The check to see whether the passed-in mode parameter was a valid member
of the enum was incorrect (at least until Python 3.12), due to a
leftover from the implementation before the mode was implemented as an
enum. This was causing a TypeError inside__contains__
, since that
can't check for values, only instances.This change updates it to attempt to construct a
Mode
enum from the
value, and catching the error if it's not a correct value.
- Verified that new try/except was the correct way to handle this.
- Ran unit tests.