mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-02-28 09:20:32 +00:00
When searching for human tasks to determine if the current user can complete it, filter on the "completed" flag.
Front-end -- enable the form if you receive an onUnathorized error because the thing you are unauthorized to do might have nothing to do with whether you can submit the form.
This commit is contained in:
parent
38dd1dcf61
commit
a248e868b7
@ -457,6 +457,7 @@ class AuthorizationService:
|
|||||||
human_task = HumanTaskModel.query.filter_by(
|
human_task = HumanTaskModel.query.filter_by(
|
||||||
task_name=spiff_task.task_spec.name,
|
task_name=spiff_task.task_spec.name,
|
||||||
process_instance_id=process_instance_id,
|
process_instance_id=process_instance_id,
|
||||||
|
completed=False
|
||||||
).first()
|
).first()
|
||||||
if human_task is None:
|
if human_task is None:
|
||||||
raise HumanTaskNotFoundError(
|
raise HumanTaskNotFoundError(
|
||||||
|
@ -42,9 +42,12 @@ export default function TaskShow() {
|
|||||||
HttpService.makeCallToBackend({
|
HttpService.makeCallToBackend({
|
||||||
path: url,
|
path: url,
|
||||||
successCallback: (tasks: any) => {
|
successCallback: (tasks: any) => {
|
||||||
|
setDisabled(false);
|
||||||
setUserTasks(tasks);
|
setUserTasks(tasks);
|
||||||
},
|
},
|
||||||
onUnauthorized: () => {},
|
onUnauthorized: () => {
|
||||||
|
setDisabled(false);
|
||||||
|
},
|
||||||
failureCallback: (error: any) => {
|
failureCallback: (error: any) => {
|
||||||
addError(error);
|
addError(error);
|
||||||
},
|
},
|
||||||
@ -61,7 +64,6 @@ export default function TaskShow() {
|
|||||||
|
|
||||||
const processSubmitResult = (result: any) => {
|
const processSubmitResult = (result: any) => {
|
||||||
removeError();
|
removeError();
|
||||||
setDisabled(false);
|
|
||||||
if (result.ok) {
|
if (result.ok) {
|
||||||
navigate(`/tasks`);
|
navigate(`/tasks`);
|
||||||
} else if (result.process_instance_id) {
|
} else if (result.process_instance_id) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user