Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
researchdata
RDMS
Commits
18172a13
Commit
18172a13
authored
1 year ago
by
Anusha Ranganathan
Browse files
Options
Downloads
Patches
Plain Diff
Made logic more readable
parent
04613f3b
Branches
feature/improve_user_creation
No related tags found
No related merge requests found
Pipeline
#7921
failed
1 year ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hyrax/app/models/user.rb
+12
-10
12 additions, 10 deletions
hyrax/app/models/user.rb
with
12 additions
and
10 deletions
hyrax/app/models/user.rb
+
12
−
10
View file @
18172a13
...
...
@@ -187,21 +187,23 @@ class User < ApplicationRecord
email
=
User
.
find_or_create_user_email
(
user_hash
)
end
if
user
if
update_user
messages
<<
"Updating user
#{
email
}
"
else
messages
<<
"Warning: User
#{
email
}
already exists. Not updating user."
user
=
nil
end
elsif
email
.
blank?
if
user
.
present?
and
not
update_user
messages
<<
"Warning: User
#{
email
}
already exists. Not updating user."
return
false
,
messages
,
user
end
if
user
.
blank?
and
email
.
blank?
messages
<<
"Error: Not creating user. User has no email, saml_id or orcid."
else
return
false
,
messages
,
nil
end
if
user
.
blank?
messages
<<
"Creating user
#{
email
}
"
user
=
User
.
new
else
messages
<<
"Updating user
#{
email
}
"
end
return
false
,
messages
,
nil
unless
user
.
present?
# email
user
.
email
=
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