Merge "fix audit delete failure: add allow func to filter audit"
This commit is contained in:
commit
8f91f05f32
|
@ -83,6 +83,9 @@ class ArchiveAudits(horizon.tables.DeleteAction):
|
||||||
verbose_name = _("Archive Audits")
|
verbose_name = _("Archive Audits")
|
||||||
policy_rules = (("infra-optim", "audit:delete"),)
|
policy_rules = (("infra-optim", "audit:delete"),)
|
||||||
|
|
||||||
|
def allowed(self, request, audit):
|
||||||
|
return audit or audit.state not in ("ONGOING", "PENDING")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
|
@ -139,7 +142,6 @@ class AuditsTable(horizon.tables.DataTable):
|
||||||
launch_actions = (CreateAudit,)
|
launch_actions = (CreateAudit,)
|
||||||
table_actions = launch_actions + (
|
table_actions = launch_actions + (
|
||||||
AuditsFilterAction,
|
AuditsFilterAction,
|
||||||
ArchiveAudits,
|
|
||||||
)
|
)
|
||||||
row_actions = (
|
row_actions = (
|
||||||
GoToActionPlan,
|
GoToActionPlan,
|
||||||
|
|
Loading…
Reference in New Issue