Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
seanh committed Feb 11, 2025
1 parent 4158b4d commit 62c6e7d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions h/schemas/forms/admin/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
GROUP_NAME_MIN_LENGTH,
)
from h.schemas import validators
from h.schemas.base import CSRFSchema
from h.util import group_scope

_ = i18n.TranslationString
Expand Down Expand Up @@ -137,9 +136,9 @@ def group_organization_select_widget(_node, kwargs):
return SelectWidget(values=list(zip(org_pubids, org_labels, strict=False)))


class AdminGroupSchema(CSRFSchema):
class AdminGroupSchema(colander.Schema):
def __init__(self, *args):
super().__init__(validator=username_validator, *args) # noqa: B026
super().__init__(*args)

group_type = colander.SchemaNode(
colander.String(),
Expand Down Expand Up @@ -207,7 +206,6 @@ def __init__(self, *args):
" of the entered scope strings (e.g. 'http://www.example.com')"
),
widget=SequenceWidget(add_subitem_text_template=_("Add scope")),
missing=colander.drop,
)

members = colander.SequenceSchema(
Expand All @@ -218,3 +216,6 @@ def __init__(self, *args):
widget=SequenceWidget(add_subitem_text_template=_("Add member")),
missing=None,
)

def validator(self, node, value):
username_validator(node, value)

0 comments on commit 62c6e7d

Please sign in to comment.