Skip to content
Snippets Groups Projects
Commit a7b8f221 authored by Te-Hung Tseng's avatar Te-Hung Tseng
Browse files

precommited and linted

parent b18a1199
No related branches found
No related tags found
No related merge requests found
...@@ -1179,7 +1179,9 @@ class AnsibleGroup(CreatedMixin, SearchableMixin, db.Model): ...@@ -1179,7 +1179,9 @@ class AnsibleGroup(CreatedMixin, SearchableMixin, db.Model):
lower_string = string.lower() lower_string = string.lower()
if GROUP_NAME_RE.fullmatch(lower_string) is None: if GROUP_NAME_RE.fullmatch(lower_string) is None:
raise ValidationError(f"Group name shall match {GROUP_NAME_RE.pattern}") raise ValidationError(f"Group name shall match {GROUP_NAME_RE.pattern}")
existing_group_name = AnsibleGroup.query.filter(AnsibleGroup.name == lower_string, AnsibleGroup.id != self.id).first() existing_group_name = AnsibleGroup.query.filter(
AnsibleGroup.name == lower_string, AnsibleGroup.id != self.id
).first()
if existing_group_name: if existing_group_name:
raise ValidationError("Group name matches an existing group") raise ValidationError("Group name matches an existing group")
return lower_string return lower_string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment