Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

backoffice: decision added to workflow admin view #97

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions backoffice/backoffice/workflows/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,21 @@ def has_delete_permission(self, request, obj=None):
}


class WorkflowsDecisionsInline(admin.StackedInline):
model = Decision
extra = 0
can_delete = False
show_change_link = True
readonly_fields = ["action_value", "_updated_at", "user"]

def has_change_permission(self, request, obj=None):
return False

@admin.display(description="action")
def action_value(self, obj):
return obj.action


@admin.register(Workflow)
class WorkflowAdmin(BaseModelAdmin):
"""
Expand All @@ -89,6 +104,8 @@ class WorkflowAdmin(BaseModelAdmin):
"_updated_at",
]

inlines = [WorkflowsDecisionsInline]


@admin.register(Decision)
class DecisionAdmin(BaseModelAdmin):
Expand Down
Loading