|
18 | 18 | )
|
19 | 19 |
|
20 | 20 | from ..choices import ACLTypeChoices
|
| 21 | +from .constants import ( |
| 22 | + ERROR_MESSAGE_ACTION_REMARK_SOURCE_PREFIX_SET, |
| 23 | + ERROR_MESSAGE_NO_REMARK, |
| 24 | + ERROR_MESSAGE_REMARK_WITHOUT_ACTION_REMARK, |
| 25 | + HELP_TEXT_ACL_ACTION, |
| 26 | + HELP_TEXT_ACL_RULE_INDEX, |
| 27 | + HELP_TEXT_ACL_RULE_LOGIC, |
| 28 | +) |
21 | 29 | from ..models import (
|
22 | 30 | AccessList,
|
23 | 31 | ACLExtendedRule,
|
|
32 | 40 | "ACLExtendedRuleForm",
|
33 | 41 | )
|
34 | 42 |
|
35 |
| -# Sets a standard mark_safe help_text value to be used by the various classes |
36 |
| -HELP_TEXT_ACL_RULE_LOGIC = mark_safe( |
37 |
| - "<b>*Note:</b> CANNOT be set if action is set to remark.", |
38 |
| -) |
39 |
| -# Sets a standard help_text value to be used by the various classes for acl action |
40 |
| -HELP_TEXT_ACL_ACTION = "Action the rule will take (remark, deny, or allow)." |
41 |
| -# Sets a standard help_text value to be used by the various classes for acl index |
42 |
| -HELP_TEXT_ACL_RULE_INDEX = ( |
43 |
| - "Determines the order of the rule in the ACL processing. AKA Sequence Number." |
44 |
| -) |
45 |
| - |
46 |
| -# Sets a standard error message for ACL rules with an action of remark, but no remark set. |
47 |
| -ERROR_MESSAGE_NO_REMARK = "Action is set to remark, you MUST add a remark." |
48 |
| -# Sets a standard error message for ACL rules with an action of remark, but no source_prefix is set. |
49 |
| -ERROR_MESSAGE_ACTION_REMARK_SOURCE_PREFIX_SET = ( |
50 |
| - "Action is set to remark, Source Prefix CANNOT be set." |
51 |
| -) |
52 |
| -# Sets a standard error message for ACL rules with an action not set to remark, but no remark is set. |
53 |
| -ERROR_MESSAGE_REMARK_WITHOUT_ACTION_REMARK = ( |
54 |
| - "CANNOT set remark unless action is set to remark." |
55 |
| -) |
56 |
| - |
57 | 43 |
|
58 | 44 | class AccessListForm(NetBoxModelForm):
|
59 | 45 | """
|
|
0 commit comments