Remove deprecated exceptions.check_message
It was deprecated 5 years ago[1] and has been kept for enough long
time.
[1] 31f7fc6bb2
Change-Id: Ie80b418c3eee3212006124be1eb4ee9f831f3d1d
This commit is contained in:
parent
116bd8ccdf
commit
47823cce7c
@ -20,7 +20,6 @@ import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
from debtcollector import removals
|
||||
from django.core.management import color_style
|
||||
from django.utils import encoding
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
@ -192,22 +191,6 @@ def error_color(msg):
|
||||
return color_style().ERROR_OUTPUT(msg)
|
||||
|
||||
|
||||
@removals.remove(message='Use exceptions.handle() instead', version='17.2.0')
|
||||
def check_message(keywords, message):
|
||||
"""Checks an exception for given keywords and raises an error if found.
|
||||
|
||||
It raises a new ``ActionError`` with the desired message if the
|
||||
keywords are found. This allows selective
|
||||
control over API error messages.
|
||||
"""
|
||||
exc_type, exc_value, exc_traceback = sys.exc_info()
|
||||
if set(str(exc_value).split(" ")).issuperset(set(keywords)):
|
||||
exc_value.message = message
|
||||
# NOTE: This function is intended to call inside an except clause.
|
||||
# pylint: disable=misplaced-bare-raise
|
||||
raise
|
||||
|
||||
|
||||
def handle_unauthorized(request, message, redirect, ignore, escalate, handled,
|
||||
force_silence, force_log,
|
||||
log_method, log_entry, log_level):
|
||||
|
@ -5,7 +5,6 @@ pbr>=5.5.0 # Apache-2.0
|
||||
|
||||
# Horizon Core Requirements
|
||||
Babel>=2.6.0 # BSD
|
||||
debtcollector>=1.2.0 # Apache-2.0
|
||||
Django>=4.2,<4.3 # BSD
|
||||
django-compressor>=2.4.1 # MIT
|
||||
django-debreach>=1.4.2 # BSD License (2 clause)
|
||||
|
Loading…
Reference in New Issue
Block a user