Skip to content

Commit

Permalink
Merge pull request #538 from oakdbca/cs-uat-changes
Browse files Browse the repository at this point in the history
CS uat changes
  • Loading branch information
xzzy authored Nov 21, 2024
2 parents d1a262a + 975f86b commit 132c7e5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
11 changes: 8 additions & 3 deletions boranga/components/conservation_status/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,9 +1357,11 @@ def final_decline(self, request, details):
if not self.can_assess(request):
raise exceptions.ProposalNotAuthorized()

if self.processing_status not in ("with_assessor", "ready_for_agenda"):
if not self.can_be_declined:
raise ValidationError(
"You cannot decline the proposal if it is not with an assessor"
"You can only decline a Conservation Status Proposal "
"if the processing status is With Assessor AND it has immediate approval level or"
"the processing status is On Agenda AND it has ministerial approval level"
)

conservation_status_decline, created = (
Expand All @@ -1373,7 +1375,6 @@ def final_decline(self, request, details):
)
)
self.proposed_decline_status = True

self.processing_status = ConservationStatus.PROCESSING_STATUS_DECLINED
self.customer_status = ConservationStatus.CUSTOMER_STATUS_DECLINED

Expand Down Expand Up @@ -1454,6 +1455,10 @@ def can_be_approved(self):
and self.approval_level == ConservationStatus.APPROVAL_LEVEL_MINISTER
)

@property
def can_be_declined(self):
return self.can_be_approved

@transaction.atomic
def final_approval(self, request, details):
self.proposed_decline_status = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,22 +313,22 @@
</div>
</template>
<template v-else-if="conservation_status_obj.processing_status == 'Proposed DeListed'">
<div class="row">
<div class="row mb-2">
<div class="col-sm-12">
<button style="width:90%;" class="btn btn-primary"
@click.prevent="switchStatus('approved')">Revert To
Approved</button><br />
</div>
</div>
<div class="row">
<div class="row mb-2">
<div class="col-sm-12">
<button style="width:90%;" class="btn btn-primary"
@click.prevent="delistProposal()">Confirm Delisting</button><br />
</div>
</div>
</template>
<template v-if="canSendBackToAssessor">
<div class="row">
<div class="row mb-2">
<div class="col-sm-12">
<button style="width:90%;" class="btn btn-primary"
@click.prevent="backToAssessor">Back To
Expand All @@ -337,15 +337,15 @@
</div>
</template>
<template v-if="canDefer">
<div class="row">
<div class="row mb-2">
<div class="col-sm-12">
<button style="width:90%;" class="btn btn-primary"
@click.prevent="deferProposal()">Defer</button><br />
</div>
</div>
</template>
<template v-if="canDiscard">
<div class="row">
<div class="row mb-2">
<div class="col-sm-12">
<button style="width:90%;" class="btn btn-primary"
@click.prevent="discardCSProposal()">Discard</button><br />
Expand Down Expand Up @@ -652,6 +652,7 @@ export default {
this.conservation_status_obj.approval_level == 'minister' &&
[
constants.PROPOSAL_STATUS.PROPOSED_FOR_AGENDA.TEXT,
constants.PROPOSAL_STATUS.READY_FOR_AGENDA.TEXT,
constants.PROPOSAL_STATUS.DEFERRED.TEXT,
].includes(this.conservation_status_obj.processing_status) &&
this.conservation_status_obj.assessor_mode.assessor_can_assess &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default {
vm.errors = false;
let decline = JSON.parse(JSON.stringify(vm.decline));
vm.decliningProposal = true;
if (vm.processing_status == 'With Assessor' || vm.processing_status == 'Ready For Agenda') {
if (vm.processing_status == 'With Assessor' || vm.processing_status == 'On Agenda') {
vm.$http.post(helpers.add_endpoint_json(api_endpoints.conservation_status, vm.conservation_status_id + '/final_decline'), JSON.stringify(decline), {
emulateJSON: true,
}).then((response) => {
Expand Down

0 comments on commit 132c7e5

Please sign in to comment.