Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
fce4dd0f
Commit
fce4dd0f
authored
4 years ago
by
Jiří Setnička
Browse files
Options
Downloads
Patches
Plain Diff
Omezení kódů úloh na písmena, čísla a -
Issue
#138
ale lepší je explicitně povolit než po jednom zakazovat.
parent
f93a6ee4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/web/org_round.py
+5
-1
5 additions, 1 deletion
mo/web/org_round.py
with
5 additions
and
1 deletion
mo/web/org_round.py
+
5
−
1
View file @
fce4dd0f
...
@@ -199,7 +199,11 @@ def org_round(id: int):
...
@@ -199,7 +199,11 @@ def org_round(id: int):
class
TaskEditForm
(
FlaskForm
):
class
TaskEditForm
(
FlaskForm
):
code
=
wtforms
.
StringField
(
'
Kód úlohy
'
)
code
=
wtforms
.
StringField
(
'
Kód úlohy
'
,
validators
=
[
validators
.
Required
(),
# trik: nelze použít \w protože obsahuje _, \W je negace \w, takže [^\W-] je \w bez _
validators
.
Regexp
(
r
'
^([^\W_]|-)+$
'
,
message
=
"
Kód úlohy smí obsahovat jen písmena, čísla a znak -
"
),
])
name
=
wtforms
.
StringField
(
'
Název úlohy
'
)
name
=
wtforms
.
StringField
(
'
Název úlohy
'
)
submit
=
wtforms
.
SubmitField
(
'
Uložit
'
)
submit
=
wtforms
.
SubmitField
(
'
Uložit
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment