Closed ldorner closed 6 days ago
Thank you for this work @ldorner. I will review probably tomorrow, depending on progress on some things I need to catch up on from some time off.
I rebased to pull in recent changes/resolve conflicts.
@ldorner Unfortunately, it looks like the added test still fails due to accessing the keys()
attribute of a tuple, which does not possess them.
@ldorner Unfortunately, it looks like the added test still fails due to accessing the
keys()
attribute of a tuple, which does not possess them.
Sorry! Bad merge. Fixed now :)
@ldorner Thanks again for this, will review early tomorrow
Overview
Currently, there is a repeated check and short-circuit in many functions to validate existence of the given country ID. This PR refactors
validate_country
as a decorator to DRY the code. We may consider transitioning this to abefore_request
hook to further reduce code repetition.This is essentially a refactor. There should be no functional change.
Changes
validate_country
to change it into a decorator/wrappervalidate_country()
check & short circuit ->@validate_country
decoratorvalidate_country
functiontest_policy.py
to ensure that the decorator functionality works