Skip to content

[ENG-11873] Delete test campaigns - #11877

Open
Ostap-Zherebetskyi wants to merge 1 commit into
CenterForOpenScience:feature/post-enter-projectfrom
Ostap-Zherebetskyi:feature/delete_campaign
Open

[ENG-11873] Delete test campaigns#11877
Ostap-Zherebetskyi wants to merge 1 commit into
CenterForOpenScience:feature/post-enter-projectfrom
Ostap-Zherebetskyi:feature/delete_campaign

Conversation

@Ostap-Zherebetskyi

@Ostap-Zherebetskyi Ostap-Zherebetskyi commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Ticket

Purpose

Delete test campaigns

Changes

Side Effects

QE Notes

CE Notes

Documentation

@Ostap-Zherebetskyi
Ostap-Zherebetskyi marked this pull request as ready for review August 25, 2026 12:22

@cslzchen cslzchen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭐ looks good and will merge after the final pair/review

if notification_campaign.status == NotificationCampaignStatus.RUNNING:
messages.error(request, 'Cannot delete a running campaign.')
return redirect('notifications:notification_campaigns_detail', pk=notification_campaign.pk)
notification_campaign.delete()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will cascade delete all the recipients and we don't have to wait for the quarterly clean-up task.

Comment on lines +200 to +211
<form
id="delete-campaign-form"
method="post"
action="{% url 'notifications:notification_campaigns_delete' notification_campaign.id %}"
style="display:inline;"
>
{% csrf_token %}
<button type="submit" class="btn btn-primary" {% if not delete_allowed %}disabled{% endif %}
title="Delete the campaign and all associated data.">
Delete Campaign
</button>
</form>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also ask for confirmation the same way as when we start a campaign? (I think so)

Comment on lines +8 to +17
<div>
{% if messages %}
<ul>
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}
</li>
{% endfor %}
</ul>
{% endif %}
</div>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used to show successful deletion after returning to the list page? (I think so too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants