Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a button to swap main and other user in user merge view #1789

Merged
merged 3 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion evap/staff/templates/staff_user_merge.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@

{% block content %}
{{ block.super }}
<h3>{% trans 'Merge users' %}</h3>
<div class="d-flex">
<h3>{% trans 'Merge users' %}</h3>
<div class="ms-auto">
<a class="btn btn-sm btn-light" href="{% url 'staff:user_merge' main_user_id=other_user.pk other_user_id=main_user.pk %}">{% trans 'Swap users' %}</a>
</div>
</div>
<div class="card mb-3">
<div class="card-body">
<table class="table mb-3">
Expand Down
4 changes: 4 additions & 0 deletions evap/staff/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ def test_shows_evaluations_voted_for(self):
"in the column of the voter and in the column of the merged data",
)

def test_shows_swap_users_option(self):
page = self.app.get(self.url, user=self.manager)
self.assertContains(page, f"/staff/user/{self.other_user.pk}/merge/{self.main_user.pk}")


class TestUserBulkUpdateView(WebTestStaffMode):
url = "/staff/user/bulk_update"
Expand Down