Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
1552b0b5
Commit
1552b0b5
authored
2 years ago
by
pabois
Browse files
Options
Downloads
Patches
Plain Diff
alumni imports
parent
7fcd9d50
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/services/importers/alumni.rb
+16
-2
16 additions, 2 deletions
app/services/importers/alumni.rb
app/services/importers/alumni_experiences.rb
+0
-1
0 additions, 1 deletion
app/services/importers/alumni_experiences.rb
with
16 additions
and
3 deletions
app/services/importers/alumni.rb
+
16
−
2
View file @
1552b0b5
...
...
@@ -16,7 +16,10 @@ module Importers
@hash
=
hash
@error
=
nil
extract_person_variables
person
.
save
if
valid?
if
valid?
person
.
save
add_picture_if_possible!
(
person
)
end
end
def
valid?
...
...
@@ -33,7 +36,6 @@ module Importers
end
def
person
# TODO: photo
@person
||=
begin
if
@email
.
present?
person
=
@university
.
people
...
...
@@ -105,5 +107,17 @@ module Importers
end
end
def
add_picture_if_possible!
(
person
)
return
if
@photo
.
nil?
return
if
@person
.
picture
.
attached?
return
unless
@photo
.
end_with?
(
'.jpg'
)
||
@photo
.
end_with?
(
'.png'
)
begin
file
=
URI
.
open
@photo
filename
=
File
.
basename
@photo
person
.
picture
.
attach
(
io:
file
,
filename:
filename
)
rescue
end
end
end
end
This diff is collapsed.
Click to expand it.
app/services/importers/alumni_experiences.rb
+
0
−
1
View file @
1552b0b5
...
...
@@ -23,7 +23,6 @@ module Importers
@hash
=
hash
@error
=
nil
extract_variables
# person.add_to_cohort cohort if valid?
end
def
valid?
...
...
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