@@ -121,16 +121,13 @@ async def patch_registered_function_job(
121121
122122 patched_job = _patch_functionjob (job , registered_function_job_patch )
123123
124- await _functions_repository .patch_function_job (
124+ result = await _functions_repository .patch_function_job (
125125 app = app ,
126- function_job_uuid = function_job_uuid ,
127126 user_id = user_id ,
128127 product_name = product_name ,
129- title = title ,
130- description = description ,
131- class_specific_data = class_specific_data ,
128+ registered_function_job_db = patched_job ,
132129 )
133- return _decode_functionjob (job )
130+ return _decode_functionjob (result )
134131
135132
136133async def register_function_job_collection (
@@ -762,7 +759,7 @@ def _decode_functionjob(
762759 return RegisteredProjectFunctionJob (
763760 uid = functionjob_db .uuid ,
764761 title = functionjob_db .title ,
765- description = "" ,
762+ description = functionjob_db . description ,
766763 function_uid = functionjob_db .function_uuid ,
767764 inputs = functionjob_db .inputs ,
768765 outputs = functionjob_db .outputs ,
@@ -777,7 +774,7 @@ def _decode_functionjob(
777774 return RegisteredSolverFunctionJob (
778775 uid = functionjob_db .uuid ,
779776 title = functionjob_db .title ,
780- description = "" ,
777+ description = functionjob_db . description ,
781778 function_uid = functionjob_db .function_uuid ,
782779 inputs = functionjob_db .inputs ,
783780 outputs = functionjob_db .outputs ,
@@ -809,10 +806,16 @@ def _patch_functionjob(
809806 outputs = function_job_db .outputs ,
810807 created = function_job_db .created ,
811808 class_specific_data = FunctionClassSpecificData (
812- project_job_id = patch .project_job_id
813- or function_job_db .class_specific_data .get ("project_job_id" ),
814- job_creation_task_id = patch .job_creation_task_id
815- or function_job_db .class_specific_data .get ("job_creation_task_id" ),
809+ project_job_id = (
810+ f"{ patch .project_job_id } "
811+ if patch .project_job_id
812+ else function_job_db .class_specific_data .get ("project_job_id" )
813+ ),
814+ job_creation_task_id = (
815+ f"{ patch .job_creation_task_id } "
816+ if patch .job_creation_task_id
817+ else function_job_db .class_specific_data .get ("job_creation_task_id" )
818+ ),
816819 ),
817820 )
818821 elif function_job_db .function_class == FunctionClass .SOLVER :
@@ -827,10 +830,16 @@ def _patch_functionjob(
827830 outputs = function_job_db .outputs ,
828831 created = function_job_db .created ,
829832 class_specific_data = FunctionClassSpecificData (
830- solver_job_id = patch .solver_job_id
831- or function_job_db .class_specific_data .get ("solver_job_id" ),
832- job_creation_task_id = patch .job_creation_task_id
833- or function_job_db .class_specific_data .get ("job_creation_task_id" ),
833+ solver_job_id = (
834+ f"{ patch .solver_job_id } "
835+ if patch .solver_job_id
836+ else function_job_db .class_specific_data .get ("solver_job_id" )
837+ ),
838+ job_creation_task_id = (
839+ f"{ patch .job_creation_task_id } "
840+ if patch .job_creation_task_id
841+ else function_job_db .class_specific_data .get ("job_creation_task_id" )
842+ ),
834843 ),
835844 )
836845 elif function_job_db .function_class == FunctionClass .PYTHON_CODE :
0 commit comments