Skip to content

Commit 5a54632

Browse files
committed
Adding missing check for Sites being removed.
1 parent 06f29ec commit 5a54632

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

eFormAPI/Plugins/Workflow.Pn/Workflow.Pn/Services/WorkflowCasesService/WorkflowCasesService.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,9 @@ await workflowPnDbContext.PluginConfigurationValues.SingleOrDefaultAsync(x =>
319319

320320
if (!string.IsNullOrEmpty(workflowDbCase.SolvedBy))
321321
{
322-
workflowCase.ToBeSolvedById = sdkDbContext.Sites.First(y => y.Name == workflowDbCase.SolvedBy).Id;
322+
workflowCase.ToBeSolvedById = sdkDbContext.Sites
323+
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
324+
.First(y => y.Name == workflowDbCase.SolvedBy).Id;
323325
}
324326

325327
return new OperationDataResult<WorkflowCasesUpdateModel>(true, workflowCase);
@@ -346,7 +348,8 @@ public async Task<OperationResult> UpdateWorkflowCase(WorkflowCasesUpdateModel m
346348
}
347349

348350
var sdkDbContext = core.DbContextHelper.GetDbContext();
349-
var solvedUser = await sdkDbContext.Sites.Where(x => x.Id == model.ToBeSolvedById)
351+
var solvedUser = await sdkDbContext.Sites
352+
.Where(x => x.Id == model.ToBeSolvedById)
350353
.Select(x => new
351354
{
352355
x.Name,

0 commit comments

Comments
 (0)