Closes #17951: Extend Ruff ruleset

This commit is contained in:
Jeremy Stretch
2024-11-07 10:24:15 -05:00
parent 812ce8471a
commit a183048891
16 changed files with 28 additions and 28 deletions

View File

@@ -49,7 +49,7 @@ def handle_rest_api_exception(request, *args, **kwargs):
"""
Handle exceptions and return a useful error message for REST API requests.
"""
type_, error, traceback = sys.exc_info()
type_, error = sys.exc_info()[:2]
data = {
'error': str(error),
'exception': type_.__name__,

View File

@@ -83,7 +83,7 @@ class CountersTest(TestCase):
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
def test_mptt_child_delete(self):
device1, device2 = Device.objects.all()
device1 = Device.objects.first()
inventory_item1 = InventoryItem.objects.create(device=device1, name='Inventory Item 1')
InventoryItem.objects.create(device=device1, name='Inventory Item 2', parent=inventory_item1)
device1.refresh_from_db()