Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
open-build-service-debian
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
obs
open-build-service-debian
Commits
a4ee2f75
Verified
Commit
a4ee2f75
authored
8 years ago
by
Björn Geuken
Committed by
Andrej Shadura
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[webui] Drop validation of user's email address
Cherry-picked from
1c264f59
parent
63621996
No related branches found
No related tags found
1 merge request
!21
OBS SSO implementation
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/api/app/models/user.rb
+3
-2
3 additions, 2 deletions
src/api/app/models/user.rb
src/api/spec/models/user_spec.rb
+0
-1
0 additions, 1 deletion
src/api/spec/models/user_spec.rb
with
3 additions
and
3 deletions
src/api/app/models/user.rb
+
3
−
2
View file @
a4ee2f75
...
@@ -355,7 +355,7 @@ class User < ActiveRecord::Base
...
@@ -355,7 +355,7 @@ class User < ActiveRecord::Base
errors
.
add
(
:password_hash_type
,
'cannot be changed unless a new password has been provided.'
)
errors
.
add
(
:password_hash_type
,
'cannot be changed unless a new password has been provided.'
)
end
end
validates
:login
,
:email
,
:password
,
:password_hash_type
,
:state
,
validates
:login
,
:password
,
:password_hash_type
,
:state
,
presence:
{
message:
'must be given'
}
presence:
{
message:
'must be given'
}
validates
:login
,
validates
:login
,
...
@@ -376,7 +376,8 @@ class User < ActiveRecord::Base
...
@@ -376,7 +376,8 @@ class User < ActiveRecord::Base
# to confirm their registration.
# to confirm their registration.
validates
:email
,
validates
:email
,
format:
{
with:
%r{
\A
([
\w\-\.\#\$
%&!?*
\'\+
=(){}|~]+)@([0-9a-zA-Z
\-\.\#\$
%&!?*
\'
=(){}|~]+)+
\z
}
,
format:
{
with:
%r{
\A
([
\w\-\.\#\$
%&!?*
\'\+
=(){}|~]+)@([0-9a-zA-Z
\-\.\#\$
%&!?*
\'
=(){}|~]+)+
\z
}
,
message:
'must be a valid email address.'
}
message:
'must be a valid email address.'
,
allow_blank:
true
}
# We want to validate the format of the password and only allow alphanumeric
# We want to validate the format of the password and only allow alphanumeric
# and some punctiation characters.
# and some punctiation characters.
...
...
This diff is collapsed.
Click to expand it.
src/api/spec/models/user_spec.rb
+
0
−
1
View file @
a4ee2f75
...
@@ -10,7 +10,6 @@ RSpec.describe User do
...
@@ -10,7 +10,6 @@ RSpec.describe User do
it
{
is_expected
.
to
validate_length_of
(
:login
).
is_at_least
(
2
).
with_message
(
'must have more than two characters.'
)
}
it
{
is_expected
.
to
validate_length_of
(
:login
).
is_at_least
(
2
).
with_message
(
'must have more than two characters.'
)
}
it
{
is_expected
.
to
validate_length_of
(
:login
).
is_at_most
(
100
).
with_message
(
'must have less than 100 characters.'
)
}
it
{
is_expected
.
to
validate_length_of
(
:login
).
is_at_most
(
100
).
with_message
(
'must have less than 100 characters.'
)
}
it
{
is_expected
.
to
validate_presence_of
(
:email
).
with_message
(
'must be given'
)
}
it
{
is_expected
.
to
allow_value
(
'king@opensuse.org'
).
for
(
:email
)
}
it
{
is_expected
.
to
allow_value
(
'king@opensuse.org'
).
for
(
:email
)
}
it
{
is_expected
.
to_not
allow_values
(
'king.opensuse.org'
,
'opensuse.org'
,
'opensuse'
).
for
(
:email
)
}
it
{
is_expected
.
to_not
allow_values
(
'king.opensuse.org'
,
'opensuse.org'
,
'opensuse'
).
for
(
:email
)
}
...
...
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