SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 4b0c924f authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Improvements

parent 9c5ab854
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ class ProfileEmailInline(admin.TabularInline):
class ProfileAdmin(admin.ModelAdmin):
list_display = ['__str__', 'email', 'discipline', 'expertises']
list_display = ['__str__', 'email', 'discipline', 'expertises', 'has_active_contributor']
search_fields = ['first_name', 'last_name', 'emails__email', 'orcid_id']
inlines = [ProfileEmailInline]
......
......@@ -121,7 +121,7 @@ $(document).ready(function($) {
<div class="single d-inline" data-specialization="{{expertise|lower}}" data-toggle="tooltip" data-placement="bottom" title="{{expertise|get_specialization_display}}">{{expertise|get_specialization_code}}</div>
{% endfor %}
</td>
<td>{% if profile.contributor %}<i class="fa fa-check-circle text-success"></i>{% else %}<i class="fa fa-times-circle text-danger"></i>{% endif %}</td>
<td>{% if profile.has_active_contributor %}<i class="fa fa-check-circle text-success"></i>{% else %}<i class="fa fa-times-circle text-danger"></i>{% endif %}</td>
</tr>
{% empty %}
<tr>
......
......@@ -42,6 +42,7 @@
{% csrf_token %}
{{ merge_form|bootstrap }}
<input class="btn btn-primary" type="submit" value="Confirm merge">
&nbsp;<a class="text-warning" href="{% url 'profiles:merge' %}?to_merge={{ profile_to_merge_into.id }}&to_merge_into={{ profile_to_merge.id }}" method="get">Merge the other way around</a></p>
</form>
</div>
</div>
......
......@@ -440,7 +440,7 @@ class ContributorMergeForm(forms.Form):
contrib_from = self.cleaned_data['to_merge']
contrib_into = self.cleaned_data['to_merge_into']
both_contribs_active = contrib_from.is_active and contrib_info.is_active
both_contribs_active = contrib_from.is_active and contrib_into.is_active
contrib_from_qs = Contributor.objects.filter(pk=contrib_from.id)
contrib_into_qs = Contributor.objects.filter(pk=contrib_into.id)
......@@ -613,7 +613,7 @@ class ContributorMergeForm(forms.Form):
if both_contribs_active:
mail_sender = DirectMailUtil(
mail_code='contributors/inform_contributor_duplicate_accounts_merged',
contrib_from=contrib_from)
contrib_from=Contributor.objects.get(id=contrib_from.id))
mail_sender.send()
return Contributor.objects.get(id=contrib_into.id)
......
......@@ -17,10 +17,11 @@
<tr><td>Personal web page: </td><td>{{ contributor.personalwebpage|default:'-' }}</td></tr>
{% if perms.scipost.can_vet_registration_requests %}
<tr><td>Username</td><td>{{ contributor.user.username }}</td></tr>
<tr><td>Email (from User)</td><td>{{ contributor.user.email }}</td></tr>
<tr><td>Status</td><td>{{ contributor.get_status_display }}</td></tr>
<tr><td>User active?</td><td>{{ contributor.user.is_active }}</td></tr>
<tr><td>Id</td><td>{{ contributor.id }}{% if contributor.profile %}&nbsp;&nbsp;<a href="{% url 'profiles:profile_detail' pk=contributor.profile.id %}">View Profile <i class="fa fa-arrow-right"></i></a>{% endif %}</td></tr>
<tr class="text-muted"><td>Username</td><td>{{ contributor.user.username }}</td></tr>
<tr class="text-muted"><td>Email (from User)</td><td>{{ contributor.user.email }}</td></tr>
<tr class="text-muted"><td>Date joined / last login</td><td>{{ contributor.user.date_joined }} / {{ contributor.user.last_login }}</td></tr>
<tr class="text-muted"><td>Status</td><td>{{ contributor.get_status_display }}</td></tr>
<tr class="text-muted"><td>User active?</td><td>{{ contributor.user.is_active }}</td></tr>
<tr class="text-muted"><td>Id</td><td>{{ contributor.id }}{% if contributor.profile %}&nbsp;&nbsp;<a href="{% url 'profiles:profile_detail' pk=contributor.profile.id %}">View Profile <i class="fa fa-arrow-right"></i></a>{% endif %}</td></tr>
{% endif %}
</table>
......@@ -2,10 +2,10 @@
Dear {{ contrib_from.duplicate_of.get_title_display }} {{ contrib_from.duplicate_of.user.last_name }},
</p>
<p>
We noticed that you had two separate registrations at SciPost, and have consolidated your two accounts into a single active one, namely your account with username <strong>{{ contrib_from.duplicate_of.user.username }}</strong>.
We noticed that you had two separate registrations at SciPost, and have consolidated your two accounts into a single active one, namely your account with username <strong><em style="color: green;">{{ contrib_from.duplicate_of.user.username }}</em></strong>.
</p>
<p>
Your alternate account with username <strong>{{ contrib_from.user.username }}</strong> has been deactivated, but all the data associated to it has been transferred to your active account.
Your alternate account with username <strong><em style="color: red;">{{ contrib_from.user.username }}</em></strong> has been deactivated, but all the data associated to it has been transferred to your active account.
</p>
<p>
Please get in touch with us at <a href="mailto:techsupport@scipost.org">SciPost techsupport</a> if you have any questions.
......
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