From aab04bcbb181cd5c6c9ffc78ea3e29442f0981bb Mon Sep 17 00:00:00 2001 From: beeankha Date: Mon, 19 Aug 2019 09:39:11 -0400 Subject: [PATCH] Fix accidental deletions, update docstrings... ... and update migration file for rebase. --- awx/main/access.py | 8 ++++++-- ...orkflow_approval.py => 0085_v360_workflow_approval.py} | 2 +- awx/main/models/notifications.py | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) rename awx/main/migrations/{0084_v360_workflow_approval.py => 0085_v360_workflow_approval.py} (98%) diff --git a/awx/main/access.py b/awx/main/access.py index 7533db162e..63b826791f 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -2781,7 +2781,7 @@ class RoleAccess(BaseAccess): class WorkflowApprovalAccess(BaseAccess): ''' - A user can create an approval template if they are a superuser, an org admin + A user can create an workflow approval if they are a superuser, an org admin of the org connected to the workflow, or if they are assigned as admins to the workflow. @@ -2790,6 +2790,8 @@ class WorkflowApprovalAccess(BaseAccess): - a workflow admin - an organization admin - any user who has explicitly been assigned the "approver" role + + A user can see approvals if they have read access to the associated WorkflowJobTemplate. ''' model = WorkflowApproval @@ -2823,7 +2825,9 @@ class WorkflowApprovalTemplateAccess(BaseAccess): - a superuser - a workflow admin - an organization admin - - any user who has explicitly been assigned the "approver" role + - any user who has explicitly been assigned the "approver" role at the workflow or organization level + + A user can see approval templates if they have read access to the associated WorkflowJobTemplate. ''' model = WorkflowApprovalTemplate diff --git a/awx/main/migrations/0084_v360_workflow_approval.py b/awx/main/migrations/0085_v360_workflow_approval.py similarity index 98% rename from awx/main/migrations/0084_v360_workflow_approval.py rename to awx/main/migrations/0085_v360_workflow_approval.py index 2f4f3fc812..a63740ac89 100644 --- a/awx/main/migrations/0084_v360_workflow_approval.py +++ b/awx/main/migrations/0085_v360_workflow_approval.py @@ -8,7 +8,7 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('main', '0083_v360_job_branch_overrirde'), + ('main', '0084_v360_token_description'), ] operations = [ diff --git a/awx/main/models/notifications.py b/awx/main/models/notifications.py index b1d902de90..677991c88e 100644 --- a/awx/main/models/notifications.py +++ b/awx/main/models/notifications.py @@ -465,7 +465,6 @@ class JobNotificationMixin(object): from awx.main.tasks import send_notifications # avoid circular import if status not in ['running', 'succeeded', 'failed']: raise ValueError(_("status must be either running, succeeded or failed")) - try: notification_templates = self.get_notification_templates() except Exception: