SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 4374e227 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

fix contributor merge to be semantically accurate

parent 596e6a2e
No related branches found
No related tags found
No related merge requests found
......@@ -14,20 +14,23 @@
<div class="row">
<div class="col-12">
{% if contributor_to_merge.user.is_active and not contributor_to_merge_into.user.is_active %}
<h3 class="text-danger">
Warning: the contributor to merge is active, while the one to merge into is not. Consider swapping the order with "Swap & Merge".
</h3>
<div id="contributor-swap-merge-btn"
class="btn btn-warning me-2"
hx-post="{% url "scipost:_hx_contributor_merge" to_merge=contributor_to_merge.id to_merge_into=contributor_to_merge_into.id %}">
Swap & Merge
</div>
{% endif %}
<div id="contributor-merge-btn"
class="btn btn-primary"
hx-post="{% url "scipost:_hx_contributor_merge" to_merge=contributor_to_merge_into.id to_merge_into=contributor_to_merge.id %}">
class="btn btn-primary me-3"
hx-post="{% url "scipost:_hx_contributor_merge" to_merge=contributor_to_merge.id to_merge_into=contributor_to_merge_into.id %}">
Merge
</div>
<div id="contributor-swap-merge-btn"
class="btn btn-secondary"
hx-post="{% url "scipost:_hx_contributor_merge" to_merge=contributor_to_merge_into.id to_merge_into=contributor_to_merge.id %}">
Swap & Merge
</div>
</div>
</div>
......@@ -1625,12 +1625,14 @@ def _hx_contributor_merge(request, to_merge: int, to_merge_into: int):
to solve one person - multiple registrations issues.
"""
post_data = {
**(request.POST or {}),
"to_merge": to_merge,
"to_merge_into": to_merge_into,
}
merge_form = ContributorMergeForm(
request.POST or None,
initial={
"to_merge": to_merge,
"to_merge_into": to_merge_into,
},
post_data,
queryset=Contributor.objects.filter(id__in=[to_merge, to_merge_into]),
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment