Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use form for expression validation in alert profiles #2667

Merged
merged 3 commits into from
Sep 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix typos
johannaengland committed Sep 6, 2023
commit 36419bc3c9f4f3b3d5b75c38ab816814fb6af511
6 changes: 3 additions & 3 deletions python/nav/web/alertprofiles/forms.py
Original file line number Diff line number Diff line change
@@ -559,7 +559,7 @@ def __init__(self, *args, **kwargs):
# Values are selected from a multiple choice list.
# Populate that list with possible choices.

# MatcField stores which table and column alert engine should
# MatchField stores which table and column alert engine should
# watch, as well as a table and column for "friendly" names in
# the GUI and how we should sort the fields in the GUI (if we
# are displaying a list)
@@ -605,8 +605,8 @@ def __init__(self, *args, **kwargs):

choices = []
for obj in model_objects:
# ID is what is acctually used in the expression that will
# be evaluted by alert engine
# ID is what is actually used in the expression that will
# be evaluated by alert engine
ident = getattr(obj, attname)

if model == name_model:
2 changes: 1 addition & 1 deletion python/nav/web/alertprofiles/views.py
Original file line number Diff line number Diff line change
@@ -1513,7 +1513,7 @@ def filter_remove(request):

@requires_post('alertprofiles-filters', ('id', 'matchfield'))
def filter_addexpression(request):
"""Shows the form to add en expression to a filter"""
"""Shows the form to add an expression to a filter"""
try:
filtr = Filter.objects.get(pk=request.POST.get('id'))
except Filter.DoesNotExist: