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

Commit

Permalink
Merge pull request #97 from DonHaul/admin-see-decisions
Browse files Browse the repository at this point in the history
backoffice: decision added to workflow admin view
  • Loading branch information
karolina-siemieniuk-morawska authored Aug 28, 2024
2 parents 77ece53 + 40d6683 commit ef63c20
Showing 1 changed file with 17 additions and 0 deletions.
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

0 comments on commit ef63c20

Please sign in to comment.