Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
f0197b5a
Commit
f0197b5a
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Allow Emails to be 254 characters long.
parent
c6597d4e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/auth/forms.py
+18
-10
18 additions, 10 deletions
app/auth/forms.py
app/models.py
+1
-1
1 addition, 1 deletion
app/models.py
migrations/versions/3ca96d906e29_.py
+2
-2
2 additions, 2 deletions
migrations/versions/3ca96d906e29_.py
with
21 additions
and
13 deletions
app/auth/forms.py
+
18
−
10
View file @
f0197b5a
from
flask_wtf
import
FlaskForm
from
flask_wtf
import
FlaskForm
from
wtforms
import
StringField
,
PasswordField
,
BooleanField
,
SubmitField
,
ValidationError
,
TextAreaField
from
wtforms
import
(
StringField
,
PasswordField
,
BooleanField
,
SubmitField
,
ValidationError
)
from
wtforms.validators
import
DataRequired
,
Length
,
Email
,
Regexp
,
EqualTo
from
wtforms.validators
import
DataRequired
,
Length
,
Email
,
Regexp
,
EqualTo
from
..models
import
User
from
..models
import
User
...
@@ -13,13 +14,20 @@ class LoginForm(FlaskForm):
...
@@ -13,13 +14,20 @@ class LoginForm(FlaskForm):
class
RegistrationForm
(
FlaskForm
):
class
RegistrationForm
(
FlaskForm
):
email
=
StringField
(
'
Email
'
,
validators
=
[
DataRequired
(),
Email
()])
email
=
StringField
(
'
Email
'
,
validators
=
[
DataRequired
(),
Email
()])
username
=
StringField
(
'
Username
'
,
validators
=
[
username
=
StringField
(
DataRequired
(),
Length
(
1
,
64
),
'
Username
'
,
Regexp
(
'
^[A-Za-z][A-Za-z0-9_.]*$
'
,
0
,
validators
=
[
DataRequired
(),
'
Usernames must have only letters, numbers, dots or
'
Length
(
1
,
64
),
'
underscores
'
)])
Regexp
(
'
^[A-Za-z][A-Za-z0-9_.]*$
'
,
password
=
PasswordField
(
'
Password
'
,
validators
=
[
0
,
DataRequired
(),
EqualTo
(
'
password2
'
,
message
=
'
Passwords must match.
'
)])
'
Usernames must have only letters, numbers, dots
'
'
or underscores
'
)]
)
password
=
PasswordField
(
'
Password
'
,
validators
=
[
DataRequired
(),
EqualTo
(
'
password2
'
,
message
=
'
Passwords must match.
'
)]
)
password2
=
PasswordField
(
'
Confirm password
'
,
validators
=
[
DataRequired
()])
password2
=
PasswordField
(
'
Confirm password
'
,
validators
=
[
DataRequired
()])
submit
=
SubmitField
(
'
Register
'
)
submit
=
SubmitField
(
'
Register
'
)
...
@@ -79,8 +87,8 @@ class ChangePasswordForm(FlaskForm):
...
@@ -79,8 +87,8 @@ class ChangePasswordForm(FlaskForm):
class
EditProfileForm
(
FlaskForm
):
class
EditProfileForm
(
FlaskForm
):
email
=
StringField
(
'
Change Email
'
,
validators
=
[
Length
(
0
,
64
),
email
=
StringField
(
'
Change Email
'
,
DataRequired
()])
validators
=
[
Length
(
0
,
254
),
DataRequired
()])
submit
=
SubmitField
(
'
Change Email
'
)
submit
=
SubmitField
(
'
Change Email
'
)
def
__init__
(
self
,
user
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
user
,
*
args
,
**
kwargs
):
...
...
This diff is collapsed.
Click to expand it.
app/models.py
+
1
−
1
View file @
f0197b5a
...
@@ -107,7 +107,7 @@ class User(UserMixin, db.Model):
...
@@ -107,7 +107,7 @@ class User(UserMixin, db.Model):
# Primary key
# Primary key
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
confirmed
=
db
.
Column
(
db
.
Boolean
,
default
=
False
)
confirmed
=
db
.
Column
(
db
.
Boolean
,
default
=
False
)
email
=
db
.
Column
(
db
.
String
(
6
4
),
unique
=
True
,
index
=
True
)
email
=
db
.
Column
(
db
.
String
(
25
4
),
unique
=
True
,
index
=
True
)
password_hash
=
db
.
Column
(
db
.
String
(
128
))
password_hash
=
db
.
Column
(
db
.
String
(
128
))
registration_date
=
db
.
Column
(
db
.
DateTime
(),
default
=
datetime
.
utcnow
)
registration_date
=
db
.
Column
(
db
.
DateTime
(),
default
=
datetime
.
utcnow
)
role_id
=
db
.
Column
(
db
.
Integer
,
db
.
ForeignKey
(
'
roles.id
'
))
role_id
=
db
.
Column
(
db
.
Integer
,
db
.
ForeignKey
(
'
roles.id
'
))
...
...
This diff is collapsed.
Click to expand it.
migrations/versions/3ca96d906e29_.py
+
2
−
2
View file @
f0197b5a
"""
empty message
"""
empty message
Revision ID: 3ca96d906e29
Revision ID: 3ca96d906e29
Revises:
Revises:
Create Date: 2019-09-05 11:43:41.634109
Create Date: 2019-09-05 11:43:41.634109
"""
"""
...
@@ -30,7 +30,7 @@ def upgrade():
...
@@ -30,7 +30,7 @@ def upgrade():
op
.
create_table
(
'
users
'
,
op
.
create_table
(
'
users
'
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
confirmed
'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'
confirmed
'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'
email
'
,
sa
.
String
(
length
=
6
4
),
nullable
=
True
),
sa
.
Column
(
'
email
'
,
sa
.
String
(
length
=
25
4
),
nullable
=
True
),
sa
.
Column
(
'
password_hash
'
,
sa
.
String
(
length
=
128
),
nullable
=
True
),
sa
.
Column
(
'
password_hash
'
,
sa
.
String
(
length
=
128
),
nullable
=
True
),
sa
.
Column
(
'
registration_date
'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'
registration_date
'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'
role_id
'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
Column
(
'
role_id
'
,
sa
.
Integer
(),
nullable
=
True
),
...
...
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