Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
SMASCH
scheduling-system
Commits
89806f53
Commit
89806f53
authored
4 years ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
added importer_user
parent
ed5601b5
No related branches found
No related tags found
1 merge request
!249
More provenance #328
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/redcap_connector.py
+11
-1
11 additions, 1 deletion
smash/web/redcap_connector.py
with
11 additions
and
1 deletion
smash/web/redcap_connector.py
+
11
−
1
View file @
89806f53
...
...
@@ -11,7 +11,7 @@ from django.conf import settings
from
django.forms.models
import
model_to_dict
from
django_cron
import
CronJobBase
,
Schedule
from
web.models
import
ConfigurationItem
,
StudySubject
,
Language
,
AppointmentType
,
Appointment
,
Visit
,
Study
from
web.models
import
ConfigurationItem
,
StudySubject
,
Language
,
AppointmentType
,
Appointment
,
Visit
,
Study
,
Provenance
,
Worker
,
User
from
web.models.constants
import
REDCAP_TOKEN_CONFIGURATION_TYPE
,
\
REDCAP_BASE_URL_CONFIGURATION_TYPE
,
CRON_JOB_TIMEOUT
,
RED_CAP_LANGUAGE_4_FIELD_TYPE
,
RED_CAP_LANGUAGE_3_FIELD_TYPE
,
\
RED_CAP_LANGUAGE_2_FIELD_TYPE
,
RED_CAP_LANGUAGE_1_FIELD_TYPE
,
RED_CAP_MPOWER_ID_FIELD_TYPE
,
RED_CAP_DEAD_FIELD_TYPE
,
\
...
...
@@ -86,6 +86,16 @@ class RedcapConnector(object):
self
.
study
=
Study
.
objects
.
get
(
id
=
GLOBAL_STUDY_ID
)
self
.
importer_user
=
None
importer_user_name
=
getattr
(
settings
,
"
IMPORTER_USER
"
,
None
)
if
importer_user_name
is
not
None
:
user
=
User
.
objects
.
filter
(
username
=
importer_user_name
)
if
user
is
None
:
logger
.
warn
(
"
User does not exist:
"
+
importer_user_name
)
else
:
self
.
importer_user
=
Worker
.
objects
.
filter
(
user
=
user
)
def
find_missing
(
self
):
pid
=
self
.
get_project_id
()
redcap_version
=
self
.
get_redcap_version
()
...
...
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