2020-11-18 20:34:50 +00:00
|
|
|
from flask import g
|
2020-11-10 15:32:37 +00:00
|
|
|
|
2021-06-02 14:00:55 +00:00
|
|
|
from crc.services.data_store_service import DataStoreBase
|
2020-11-18 20:34:50 +00:00
|
|
|
from crc.scripts.script import Script
|
2020-11-10 15:32:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
class UserDataSet(Script,DataStoreBase):
|
|
|
|
def get_description(self):
|
2021-02-24 17:05:06 +00:00
|
|
|
return """Sets user data to the data store these are positional arguments key and value.
|
|
|
|
example: user_data_set('mykey','myvalue')
|
|
|
|
"""
|
2020-11-10 15:32:37 +00:00
|
|
|
|
|
|
|
def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs):
|
2020-11-10 16:32:59 +00:00
|
|
|
self.set_validate_common(None,
|
|
|
|
workflow_id,
|
|
|
|
g.user.uid,
|
|
|
|
'user_data_set',
|
2021-04-26 13:41:14 +00:00
|
|
|
None,
|
2020-11-10 16:32:59 +00:00
|
|
|
*args)
|
2020-11-10 15:32:37 +00:00
|
|
|
|
|
|
|
def do_task(self, task, study_id, workflow_id, *args, **kwargs):
|
2020-11-11 14:44:58 +00:00
|
|
|
return self.set_data_common(task.id,
|
2020-11-10 16:32:59 +00:00
|
|
|
None,
|
|
|
|
g.user.uid,
|
|
|
|
workflow_id,
|
2020-11-11 14:44:58 +00:00
|
|
|
None,
|
2020-11-10 16:32:59 +00:00
|
|
|
'user_data_set',
|
2021-04-26 13:41:14 +00:00
|
|
|
None,
|
2020-11-10 16:32:59 +00:00
|
|
|
*args,
|
|
|
|
**kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|