From fab677807482685524ddd58f4c103185cbea8d7b Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Mon, 30 Jan 2023 15:04:01 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- netbox_acls/forms/models.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/netbox_acls/forms/models.py b/netbox_acls/forms/models.py index 256b506..104a889 100644 --- a/netbox_acls/forms/models.py +++ b/netbox_acls/forms/models.py @@ -513,14 +513,13 @@ def _check_if_interface_already_has_acl_in_direction( direction=direction, ).exists(): return {} - else: - error_interface_already_assigned = ( - "Interfaces can only have 1 Access List assigned in each direction." - ) - return { - "direction": [error_interface_already_assigned], - assigned_object_type: [error_interface_already_assigned], - } + error_interface_already_assigned = ( + "Interfaces can only have 1 Access List assigned in each direction." + ) + return { + "direction": [error_interface_already_assigned], + assigned_object_type: [error_interface_already_assigned], + } def save(self, *args, **kwargs): """