Skip to content
Snippets Groups Projects
Commit baca96d3 authored by Felix Schäfer's avatar Felix Schäfer :construction_worker:
Browse files

Simplify code

parent 27db6825
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,11 @@ class MatrixInviterForm(SettingsForm): ...@@ -36,6 +36,11 @@ class MatrixInviterForm(SettingsForm):
label=_("Invitation message"), label=_("Invitation message"),
required=False, required=False,
) )
matrix_inviter_matrix_room = RegexField(
label=_("Matrix room"),
regex="(!|#)[^:]+:.+",
strip=True,
)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
...@@ -56,10 +61,6 @@ class MatrixInviterForm(SettingsForm): ...@@ -56,10 +61,6 @@ class MatrixInviterForm(SettingsForm):
) )
else: else:
room_help_text = _('"{name}" (<code>{room_id}</code>)') room_help_text = _('"{name}" (<code>{room_id}</code>)')
self.fields["matrix_inviter_matrix_room"].help_text = room_help_text.format_map(
self.fields["matrix_inviter_matrix_room"] = RegexField( room_info
label=_("Matrix room"),
regex="(!|#)[^:]+:.+",
strip=True,
help_text=(room_help_text.format_map(room_info)),
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment