Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
subato2
Manage
Activity
Members
Labels
Plan
Issues
30
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
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
Subato Learning System
subato2
Merge requests
!55
2.0.0-beta8
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
2.0.0-beta8
develop
into
main
Overview
0
Commits
10
Pipelines
0
Changes
16
Merged
Björn Fischer
requested to merge
develop
into
main
1 year ago
Overview
0
Commits
10
Pipelines
0
Changes
16
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
8685d3de
10 commits,
1 year ago
16 files
+
58
−
48
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
16
Search (e.g. *.vue) (Ctrl+P)
subato/src/main/java/de/hsrm/sls/subato/aor/term/imp/unit/LecturerImportService.java
+
14
−
17
Options
@@ -33,29 +33,26 @@ public class LecturerImportService {
}
private
User
getOrCreateLecturer
(
Lecturer
lecturer
)
{
User
user
=
null
;
if
(
lecturer
.
getUser
().
getHdsName
()
!=
null
)
{
var
hdsLoginName
=
lecturer
.
getUser
().
getHdsName
();
var
user
=
userRepository
.
findByLoginNameIgnoreCase
(
hdsLoginName
).
orElse
(
null
);
if
(
user
==
null
)
{
user
=
new
User
();
user
.
setLoginName
(
hdsLoginName
);
user
.
setFirstName
(
lecturer
.
getFirstName
());
user
.
setLastName
(
lecturer
.
getLastName
());
user
.
setMail
(
lecturer
.
getEmail
());
}
user
=
userRepository
.
findByLoginNameIgnoreCase
(
hdsLoginName
).
orElse
(
null
);
}
return
userRepository
.
save
(
user
);
}
else
{
var
user
=
userRepository
.
findByMailIgnoreCase
(
lecturer
.
getEmail
()).
orElse
(
null
);
if
(
user
==
null
)
{
user
=
new
User
();
user
.
setFirstName
(
lecturer
.
getFirstName
());
user
.
setLastName
(
lecturer
.
getLastName
());
user
.
setMail
(
lecturer
.
getEmail
());
}
if
(
user
==
null
)
{
user
=
userRepository
.
findByMailIgnoreCase
(
lecturer
.
getEmail
()).
orElse
(
null
);
}
if
(
user
==
null
)
{
user
=
new
User
();
user
.
setLoginName
(
lecturer
.
getUser
().
getHdsName
());
user
.
setFirstName
(
lecturer
.
getFirstName
());
user
.
setLastName
(
lecturer
.
getLastName
());
user
.
setMail
(
lecturer
.
getEmail
());
return
userRepository
.
save
(
user
);
}
return
user
;
}
private
void
setLecturers
(
CourseUnit
courseUnit
,
ArrayList
<
User
>
users
)
{
Loading