# HG changeset patch # User John Rouillard # Date 1734648984 18000 # Node ID c24b022660774b16e8a5b6ee7fa344be30f14101 # Parent 11ebd3a19c9a96ef178de500913888e0620afda2 chore(ruff): handle magic number warnings. Suppressed one error as the error message that follows provides enough context. diff -r 11ebd3a19c9a -r c24b02266077 roundup/rest.py --- a/roundup/rest.py Thu Dec 19 17:51:48 2024 -0500 +++ b/roundup/rest.py Thu Dec 19 17:56:24 2024 -0500 @@ -109,7 +109,8 @@ # decorate it self.client.response_code = code - if code >= 400: # any error require error format + ERROR_CODE_LOWER_BOUND = 400 + if code >= ERROR_CODE_LOWER_BOUND: # any error require error format logmethod = getattr(logger, self.db.config.WEB_REST_LOGGING, None) if logmethod: logmethod("statuscode: %s" % code) @@ -751,7 +752,8 @@ # Do not show the (possibly HUGE) content prop # unless very verbose, we display the standard # download link instead - if verbose < 3: + MIN_VERBOSE_LEVEL_SHOW_CONTENT = 3 + if verbose < MIN_VERBOSE_LEVEL_SHOW_CONTENT: u = self.db.config.TRACKER_WEB p = u + '%s%s/' % (class_name, node.id) result[pn] = {"link": p} @@ -1254,7 +1256,7 @@ except ValueError: raise UsageError("Value 'lifetime' must be an integer specify lifetime in seconds. Got %s." % input_payload['lifetime'].value) - if lifetime > 3600 or lifetime < 1: + if lifetime > 3600 or lifetime < 1: # noqa: PLR2004 raise UsageError("Value 'lifetime' must be between 1 second and 1 hour (3600 seconds). Got %s." % input_payload['lifetime'].value) try: