Skip to content

Commit 675a72d

Browse files
committed
refactor: Re-order; Adapt Comments; Use Constants
1 parent 0bc9cf2 commit 675a72d

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

netbox_acls/models/access_list_rules.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,22 +198,17 @@ class Meta(ACLRule.Meta):
198198
class ACLExtendedRule(ACLRule):
199199
"""
200200
Inherits ACLRule.
201-
Add ACLExtendedRule specific fields: source_ports, desintation_prefix, destination_ports, and protocol
201+
Add ACLExtendedRule specific fields: destination, source_ports, destination_ports and protocol
202202
"""
203203

204204
access_list = models.ForeignKey(
205205
on_delete=models.CASCADE,
206206
to=AccessList,
207207
verbose_name="Extended Access List",
208-
limit_choices_to={"type": "extended"},
208+
limit_choices_to={"type": ACLTypeChoices.TYPE_EXTENDED},
209209
related_name="aclextendedrules",
210210
)
211-
source_ports = ArrayField(
212-
base_field=models.PositiveIntegerField(),
213-
blank=True,
214-
null=True,
215-
verbose_name="Soure Ports",
216-
)
211+
217212
destination_prefix = models.ForeignKey(
218213
blank=True,
219214
null=True,
@@ -254,6 +249,13 @@ class ACLExtendedRule(ACLRule):
254249
to=Service,
255250
verbose_name="Destination Service",
256251
)
252+
253+
source_ports = ArrayField(
254+
base_field=models.PositiveIntegerField(),
255+
blank=True,
256+
null=True,
257+
verbose_name="Source Ports",
258+
)
257259
destination_ports = ArrayField(
258260
base_field=models.PositiveIntegerField(),
259261
blank=True,

0 commit comments

Comments
 (0)