From 81640102d5c7e9a996af948733134f55989b5411 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 18 Oct 2021 14:12:22 -0700 Subject: [PATCH] Use keyword argument for FeatureDisabled message. --- etiquette/decorators.py | 2 +- etiquette/exceptions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etiquette/decorators.py b/etiquette/decorators.py index 5e9a7b4..5aa4f3f 100644 --- a/etiquette/decorators.py +++ b/etiquette/decorators.py @@ -31,7 +31,7 @@ def required_feature(features): pass elif cfg is False: - raise exceptions.FeatureDisabled(feature) + raise exceptions.FeatureDisabled(requires=feature) else: raise ValueError(f'Bad required_feature: "{feature}" led to {cfg}.') diff --git a/etiquette/exceptions.py b/etiquette/exceptions.py index 6b0d582..807043d 100644 --- a/etiquette/exceptions.py +++ b/etiquette/exceptions.py @@ -185,7 +185,7 @@ class FeatureDisabled(EtiquetteException): ''' For when features of the system have been disabled by the configuration. ''' - error_message = 'This feature has been disabled. Requires {}.' + error_message = 'This feature has been disabled. Requires {requires}.' class NoClosestPhotoDB(EtiquetteException): '''