Fish Trophy

david got a fish trophy!

Fish Trophy

Fix handling of the "mode" parameter to the SAML link user view.

Review Request #12921 — Created March 24, 2023 and submitted

Information

Review Board
release-5.0.x

Reviewers

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.
Summary ID
Fix handling of the "mode" parameter to the SAML link user view.
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. Testing Done: - Verified that new try/except was the correct way to handle this. - Ran unit tests.
9223fc839da4e3a169a84c6555a7c6eaba3bf2c6
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.0.x (dbbe765)