From 79327de0f0e025b830e0d03584f6d467c7e08c5a Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 1 Jan 2021 13:23:32 -0800 Subject: [PATCH] Rearrange these continues into relevant condition. --- etiquette/searchhelpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etiquette/searchhelpers.py b/etiquette/searchhelpers.py index f79943e..b99920b 100644 --- a/etiquette/searchhelpers.py +++ b/etiquette/searchhelpers.py @@ -320,9 +320,9 @@ def normalize_orderby(orderby, warning_bag=None): exc = ValueError(constants.WARNING_ORDERBY_INVALID.format(request=requested_order)) if warning_bag: warning_bag.add(exc) + continue else: raise exc - continue if direction not in ('asc', 'desc'): message = constants.WARNING_ORDERBY_BADDIRECTION.format( @@ -332,17 +332,17 @@ def normalize_orderby(orderby, warning_bag=None): exc = ValueError(message) if warning_bag: warning_bag.add(exc) + direction = 'desc' else: raise exc - direction = 'desc' if column not in constants.ALLOWED_ORDERBY_COLUMNS: exc = ValueError(constants.WARNING_ORDERBY_BADCOL.format(column=column)) if warning_bag: warning_bag.add(exc) + continue else: raise exc - continue if column == 'random': column = 'RANDOM()'