2020-11-18 15:34:50 -05:00
|
|
|
from flask import g
|
2020-11-10 10:32:37 -05:00
|
|
|
|
2020-11-18 15:34:50 -05:00
|
|
|
from crc.scripts.data_store_base import DataStoreBase
|
|
|
|
from crc.scripts.script import Script
|
2020-11-10 10:32:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
class UserDataSet(Script,DataStoreBase):
|
|
|
|
def get_description(self):
|
|
|
|
return """Sets user data to the data store."""
|
|
|
|
|
|
|
|
def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs):
|
2020-11-10 11:32:59 -05:00
|
|
|
self.set_validate_common(None,
|
|
|
|
workflow_id,
|
|
|
|
g.user.uid,
|
|
|
|
'user_data_set',
|
|
|
|
*args)
|
2020-11-10 10:32:37 -05:00
|
|
|
|
|
|
|
def do_task(self, task, study_id, workflow_id, *args, **kwargs):
|
2020-11-11 09:44:58 -05:00
|
|
|
return self.set_data_common(task.id,
|
2020-11-10 11:32:59 -05:00
|
|
|
None,
|
|
|
|
g.user.uid,
|
|
|
|
workflow_id,
|
2020-11-11 09:44:58 -05:00
|
|
|
None,
|
2020-11-10 11:32:59 -05:00
|
|
|
'user_data_set',
|
|
|
|
*args,
|
|
|
|
**kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|