Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
greg
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
it-bott-integrasjoner
greg
Commits
c7ddbe24
Commit
c7ddbe24
authored
3 years ago
by
Sivert Kronen Hatteberg
Browse files
Options
Downloads
Plain Diff
Merge branch 'GREG-95-cerebrum-sponsor-import' into 'master'
Remove check on emplyee status. See merge request
!151
parents
4a9afdeb
a0ea6de7
No related branches found
No related tags found
1 merge request
!151
Remove check on emplyee status.
Pipeline
#100441
passed
3 years ago
Stage: venv update
Stage: tests and linting
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
greg/management/commands/import_sponsors_from_cerebrum.py
+0
-15
0 additions, 15 deletions
greg/management/commands/import_sponsors_from_cerebrum.py
with
0 additions
and
15 deletions
greg/management/commands/import_sponsors_from_cerebrum.py
+
0
−
15
View file @
c7ddbe24
...
@@ -33,17 +33,6 @@ class Command(BaseCommand):
...
@@ -33,17 +33,6 @@ class Command(BaseCommand):
super
().
__init__
(
*
args
,
**
kwargs
)
super
().
__init__
(
*
args
,
**
kwargs
)
self
.
client
=
CerebrumClient
(
**
settings
.
CEREBRUM_CLIENT
)
self
.
client
=
CerebrumClient
(
**
settings
.
CEREBRUM_CLIENT
)
def
_has_active_dfo_aff
(
self
,
person_id
:
str
):
"""
Check that a person has a valid employee affiliation from DFØ.
"""
dfo_employee_affs
=
[
x
for
x
in
self
.
client
.
get_person_affiliations
(
person_id
)
if
x
.
source_system
==
"
DFO_SAP
"
and
x
.
affiliation
==
"
ANSATT
"
]
return
len
(
dfo_employee_affs
)
>
0
def
_upsert_sponsor_unit_link
(
self
,
sponsor
:
Sponsor
,
unit
:
OrganizationalUnit
):
def
_upsert_sponsor_unit_link
(
self
,
sponsor
:
Sponsor
,
unit
:
OrganizationalUnit
):
"""
Ensure a link between sponsor and unit.
"""
"""
Ensure a link between sponsor and unit.
"""
sunit
,
created
=
SponsorOrganizationalUnit
.
objects
.
get_or_create
(
sunit
,
created
=
SponsorOrganizationalUnit
.
objects
.
get_or_create
(
...
@@ -95,10 +84,6 @@ class Command(BaseCommand):
...
@@ -95,10 +84,6 @@ class Command(BaseCommand):
logger
.
warning
(
"
cerebrum_person_missing
"
,
cerebrum_person_id
=
person_id
)
logger
.
warning
(
"
cerebrum_person_missing
"
,
cerebrum_person_id
=
person_id
)
return
None
return
None
if
not
self
.
_has_active_dfo_aff
(
person_id
):
logger
.
warning
(
"
cerebrum_not_an_employee
"
,
cerebrum_person_id
=
person_id
)
return
None
feide_id
=
self
.
_get_feide_id
(
person_id
)
feide_id
=
self
.
_get_feide_id
(
person_id
)
if
not
feide_id
:
if
not
feide_id
:
logger
.
warning
(
"
cerebrum_no_primary_account
"
,
cerebrum_person_id
=
person_id
)
logger
.
warning
(
"
cerebrum_no_primary_account
"
,
cerebrum_person_id
=
person_id
)
...
...
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