mirror of
https://github.com/simple-login/app.git
synced 2025-02-25 08:13:16 +08:00
validate regex before creating rule
This commit is contained in:
parent
f160ebec4e
commit
1e3afa257c
1 changed files with 14 additions and 0 deletions
|
@ -451,6 +451,20 @@ def domain_detail_auto_create(custom_domain_id):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
re.compile(new_auto_create_rule_form.regex.data)
|
||||||
|
except:
|
||||||
|
flash(
|
||||||
|
f"Invalid regex {new_auto_create_rule_form.regex.data}",
|
||||||
|
"error",
|
||||||
|
)
|
||||||
|
return redirect(
|
||||||
|
url_for(
|
||||||
|
"dashboard.domain_detail_auto_create",
|
||||||
|
custom_domain_id=custom_domain.id,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
rule = AutoCreateRule.create(
|
rule = AutoCreateRule.create(
|
||||||
custom_domain_id=custom_domain.id,
|
custom_domain_id=custom_domain.id,
|
||||||
order=int(new_auto_create_rule_form.order.data),
|
order=int(new_auto_create_rule_form.order.data),
|
||||||
|
|
Loading…
Reference in a new issue