Skip to content

Commit

Permalink
backoffice: decision added to workflow admin view
Browse files Browse the repository at this point in the history
  • Loading branch information
DonHaul committed Aug 27, 2024
1 parent 716a25c commit bcefebd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions backoffice-repo/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

0 comments on commit bcefebd

Please sign in to comment.