Skip to content

Commit

Permalink
Merge pull request #530 from GhostManager/hotfix/fixed-duplicate-vali…
Browse files Browse the repository at this point in the history
…dation-errors

Fixed repeated validation errors when duplicate entries are detected
  • Loading branch information
chrismaddalena authored Sep 27, 2024
2 parents 88ef6a4 + 8589bfb commit e56d9e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ghostwriter/rolodex/forms_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def clean(self):
code="duplicate",
),
)
duplicates = False
# Check that all objective have a deadline and status
if deadline and not objective:
form.add_error(
Expand Down Expand Up @@ -182,6 +183,7 @@ def clean(self):
code="duplicate",
),
)
duplicates = False

# Raise an error if an operator is selected provided without any required details
if operator and any(x is None for x in [start_date, end_date, role]):
Expand Down Expand Up @@ -280,6 +282,7 @@ def clean(self):
code="duplicate",
),
)
duplicates = False
if name or description:
if not scope:
form.add_error(
Expand Down
5 changes: 4 additions & 1 deletion ghostwriter/shepherd/forms_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def clean(self):
code="duplicate",
),
)
duplicates = False

# Check that only one address is marked as the primary
if primary and ip_address:
Expand Down Expand Up @@ -253,7 +254,9 @@ def __init__(self, *args, **kwargs):
<h4 class="icon custom-field-icon">Extra Fields</h4>
<hr />
"""
) if has_extra_fields else None,
)
if has_extra_fields
else None,
"extra_fields" if has_extra_fields else None,
link_css_class="icon server-icon",
css_id="server",
Expand Down

0 comments on commit e56d9e3

Please sign in to comment.