From 17f86f3e818990b49931d89f346dfd9df46c1d78 Mon Sep 17 00:00:00 2001 From: Jesse London Date: Thu, 3 Dec 2020 16:59:45 -0600 Subject: [PATCH] fix user display (#58) * fixed user badge "title" pop-over by eliminating leading & trailing whitespace from attribute value * fixed listing of users missing first/last name -- fall back to username * fixed display of users missing first/last name -- everywhere else across site (fall back to username) * display users' contact info to logged-in sessions (only) * email addresses are listed -- along with user names -- most-anywhere they fit * email addresses are mailto: links in administrative pages * any add'l contact info (e.g. phone) listed on user profile resolves #57 --- src/marketplace/domain/proj.py | 28 +++++++++---------- src/marketplace/models/proj.py | 2 +- src/marketplace/models/user.py | 6 ++-- .../marketplace/components/user_badge.html | 3 +- .../marketplace/components/user_display.html | 17 +++++++---- .../templates/marketplace/org_staff.html | 8 +++--- .../templates/marketplace/org_staff_edit.html | 3 +- .../marketplace/org_staff_remove.html | 4 ++- .../marketplace/org_staff_request_review.html | 5 ++-- .../templates/marketplace/proj_staff.html | 4 +-- .../marketplace/proj_staff_edit.html | 3 +- .../marketplace/proj_staff_remove.html | 3 +- .../proj_volunteer_application_review.html | 6 ++-- .../marketplace/proj_volunteer_remove.html | 2 +- .../marketplace/proj_volunteers.html | 8 +++--- .../templates/marketplace/pwd_reset.html | 2 +- .../templates/marketplace/user_profile.html | 16 +++++++++-- .../templates/marketplace/volunteer_list.html | 8 ++++-- src/marketplace/templatetags/include_redux.py | 28 +++++++++++++++++++ src/marketplace/templatetags/text.py | 17 +++++++++++ src/marketplace/views/user.py | 2 +- 21 files changed, 123 insertions(+), 52 deletions(-) create mode 100644 src/marketplace/templatetags/include_redux.py create mode 100644 src/marketplace/templatetags/text.py diff --git a/src/marketplace/domain/proj.py b/src/marketplace/domain/proj.py index 390384f..eb1379c 100644 --- a/src/marketplace/domain/proj.py +++ b/src/marketplace/domain/proj.py @@ -442,7 +442,7 @@ def create_project(request_user, project, organization, organization_members): qa_channel.save() - message = "The project {0} was created by {1} within the organization {2}.".format(project.name, request_user.standard_display_name(), organization.name) + message = "The project {0} was created by {1} within the organization {2}.".format(project.name, request_user.standard_display_name, organization.name) NotificationService.add_multiuser_notification(organization_members, message, NotificationSeverity.INFO, @@ -461,7 +461,7 @@ def save_project(request_user, projid, project): validate_consistent_keys(project, ('id', projid)) ensure_user_has_permission(request_user, project, 'project.information_edit') project.save() - message = "The project {0} was edited by {1}.".format(project.name, request_user.standard_display_name()) + message = "The project {0} was edited by {1}.".format(project.name, request_user.standard_display_name) NotificationService.add_multiuser_notification(ProjectService.get_public_notification_users(request_user, project), message, NotificationSeverity.INFO, @@ -500,7 +500,7 @@ def publish_project(request_user, projid, project): # working on domain tasks? project.actual_start_date = timezone.now() project.save() - message = "The project {0} was published by {1} and can now be applied to by volunteers.".format(project.name, request_user.standard_display_name()) + message = "The project {0} was published by {1} and can now be applied to by volunteers.".format(project.name, request_user.standard_display_name) NotificationService.add_multiuser_notification(ProjectService.get_project_members(request_user, project), message, NotificationSeverity.WARNING, @@ -543,7 +543,7 @@ def add_staff_member(request_user, projid, project_role): try: previous_members = ProjectService.get_project_members(request_user, project) project_role.save() - message = "New staff member {0} added to the project {1} with role {2}.".format(project_role.user.standard_display_name(), project.name, project_role.get_role_display()) + message = "New staff member {0} added to the project {1} with role {2}.".format(project_role.user.standard_display_name, project.name, project_role.get_role_display()) NotificationService.add_multiuser_notification(previous_members, message, NotificationSeverity.INFO, @@ -576,7 +576,7 @@ def save_project_role(request_user, projid, project_role): raise ValueError('You are trying to remove the last administrator of the project. Please appoint another administrator before removing the current one.') project_role.save() project = project_role.project - message = "The role of {0} in project {1} has been changed to {2}.".format(project_role.user.standard_display_name(), project.name, project_role.get_role_display()) + message = "The role of {0} in project {1} has been changed to {2}.".format(project_role.user.standard_display_name, project.name, project_role.get_role_display()) NotificationService.add_multiuser_notification(ProjectService.get_project_members(request_user, project), message, NotificationSeverity.INFO, @@ -602,7 +602,7 @@ def delete_project_role(request_user, projid, project_role): raise ValueError('You are trying to remove the last administrator of the project. Please appoint another administrator before removing the current one.') project_role.delete() project = project_role.project - message = "The user {0} has been removed from the staff of project {1}.".format(project_role.user.standard_display_name(), project.name) + message = "The user {0} has been removed from the staff of project {1}.".format(project_role.user.standard_display_name, project.name) NotificationService.add_multiuser_notification(ProjectService.get_project_members(request_user, project), message, NotificationSeverity.INFO, @@ -650,7 +650,7 @@ def update_project_scope(request_user, projid, project_scope): project_scope.creation_date = None try: project_scope.save() - message = "The project scope of project {0} was edited by {1}.".format(project.name, request_user.standard_display_name()) + message = "The project scope of project {0} was edited by {1}.".format(project.name, request_user.standard_display_name) NotificationService.add_multiuser_notification(ProjectService.get_project_members(request_user, project), message, NotificationSeverity.INFO, @@ -1353,7 +1353,7 @@ def cancel_volunteering(request_user, projid, taskid, project_task_role): project_task.accepting_volunteers = True ProjectTaskService.save_task_internal(request_user, projid, taskid, project_task) project = project_task.project - message = "The volunteer {0} working on task {1} of project {2} has canceled the work and has stopped volunteering in the project.".format(project_task_role.user.standard_display_name(), project_task.name, project.name) + message = "The volunteer {0} working on task {1} of project {2} has canceled the work and has stopped volunteering in the project.".format(project_task_role.user.standard_display_name, project_task.name, project.name) NotificationService.add_multiuser_notification(ProjectService.get_project_members(request_user, project), message, NotificationSeverity.ERROR, @@ -1389,7 +1389,7 @@ def apply_to_volunteer(request_user, projid, taskid, task_application_request): task_application_request.volunteer = request_user task_application_request.save() project = project_task.project - message = "User {0} has applied to volunteer on task {1} of project {2}. Please review the application and accept or reject it as soon as possible.".format(task_application_request.volunteer.standard_display_name(), project_task.name, project.name) + message = "User {0} has applied to volunteer on task {1} of project {2}. Please review the application and accept or reject it as soon as possible.".format(task_application_request.volunteer.standard_display_name, project_task.name, project.name) NotificationService.add_multiuser_notification(ProjectService.get_project_officials(request_user, project), message, NotificationSeverity.WARNING, @@ -1485,7 +1485,7 @@ def accept_volunteer(request_user, projid, taskid, volunteer_application): ProjectTaskService.save_volunteer_application(request_user, projid, taskid, volunteer_application) project_task = volunteer_application.task project = project_task.project - message = "The user {0} has been accepted as volunteer for task {1} of project {2}.".format(volunteer_application.volunteer.standard_display_name(), project_task.name, project.name) + message = "The user {0} has been accepted as volunteer for task {1} of project {2}.".format(volunteer_application.volunteer.standard_display_name, project_task.name, project.name) NotificationService.add_multiuser_notification(ProjectService.get_project_members(request_user, project), message, NotificationSeverity.INFO, @@ -1516,7 +1516,7 @@ def reject_volunteer(request_user, projid, taskid, volunteer_application): ProjectTaskService.save_volunteer_application(request_user, projid, taskid, volunteer_application) project_task = volunteer_application.task project = project_task.project - message = "The user {0} has been rejected as volunteer for task {1} of project {2}.".format(volunteer_application.volunteer.standard_display_name(), project_task.name, project.name) + message = "The user {0} has been rejected as volunteer for task {1} of project {2}.".format(volunteer_application.volunteer.standard_display_name, project_task.name, project.name) NotificationService.add_multiuser_notification(ProjectService.get_project_members(request_user, project), message, NotificationSeverity.INFO, @@ -1687,7 +1687,7 @@ def save_project_task_role(request_user, projid, taskid, project_task_role): if project_task.stage == TaskStatus.COMPLETED: raise ValueError('Cannot edit the role of a completed task') project_task_role.save() - message = "The volunteer {0} of project {1} has been assigned to the task {2}.".format(project_task_role.user.standard_display_name(), project.name, project_task.name) + message = "The volunteer {0} of project {1} has been assigned to the task {2}.".format(project_task_role.user.standard_display_name, project.name, project_task.name) NotificationService.add_multiuser_notification(ProjectService.get_project_members(request_user, project), message, NotificationSeverity.INFO, @@ -1714,7 +1714,7 @@ def delete_project_task_role(request_user, projid, taskid, project_task_role): if project_task.stage == TaskStatus.COMPLETED: raise ValueError('Cannot delete the role of a completed task') project_task_role.delete() - message = "The volunteer {0} has been removed from task {1} of project {2}.".format(project_task_role.user.standard_display_name(), project_task.name, project.name) + message = "The volunteer {0} has been removed from task {1} of project {2}.".format(project_task_role.user.standard_display_name, project_task.name, project.name) NotificationService.add_multiuser_notification(ProjectService.get_project_members(request_user, project), message, NotificationSeverity.INFO, @@ -1804,7 +1804,7 @@ def publish_project_task(request_user, projid, taskid, project_task): if project_task.stage == TaskStatus.DRAFT: project_task.stage = TaskStatus.NOT_STARTED project_task.save() - message = "The project task {0} from project {1} was published by {2}.".format(project_task.name, project.name, request_user.standard_display_name()) + message = "The project task {0} from project {1} was published by {2}.".format(project_task.name, project.name, request_user.standard_display_name) NotificationService.add_multiuser_notification(ProjectService.get_project_members(request_user, project), message, NotificationSeverity.WARNING, diff --git a/src/marketplace/models/proj.py b/src/marketplace/models/proj.py index ee218e4..de2e417 100644 --- a/src/marketplace/models/proj.py +++ b/src/marketplace/models/proj.py @@ -1040,7 +1040,7 @@ class ProjectTaskRole(models.Model): ) def __str__(self): - return self.user.standard_display_name() + "-" + self.task.name + "-" + self.get_role_display() + return self.user.standard_display_name + "-" + self.task.name + "-" + self.get_role_display() class Meta: unique_together = ('user', 'task', 'role') diff --git a/src/marketplace/models/user.py b/src/marketplace/models/user.py index beb98c3..8d4eaaf 100644 --- a/src/marketplace/models/user.py +++ b/src/marketplace/models/user.py @@ -80,11 +80,13 @@ class User(AbstractUser): objects = UserManager() + @property def full_name(self): - return self.first_name + " " + self.last_name + return ' '.join(part for part in (self.first_name, self.last_name) if part) + @property def standard_display_name(self): - return self.full_name() + "(" + self.username + ")" + return f'{self.full_name} ({self.username})' if self.full_name else self.username def is_type_dssg_staff(self): return self.initial_type == UserType.DSSG_STAFF diff --git a/src/marketplace/templates/marketplace/components/user_badge.html b/src/marketplace/templates/marketplace/components/user_badge.html index ffb8490..4065195 100644 --- a/src/marketplace/templates/marketplace/components/user_badge.html +++ b/src/marketplace/templates/marketplace/components/user_badge.html @@ -1,6 +1,7 @@ +{% load include_redux %} + title="{% include-stripped 'marketplace/components/user_badge_text.html' %}"> {% if badge.is_type_work_speed %} {% elif badge.is_type_early_user %} diff --git a/src/marketplace/templates/marketplace/components/user_display.html b/src/marketplace/templates/marketplace/components/user_display.html index 2cc4e43..4cd6dd8 100644 --- a/src/marketplace/templates/marketplace/components/user_display.html +++ b/src/marketplace/templates/marketplace/components/user_display.html @@ -1,11 +1,16 @@ {% if not hide_anchor %}{% endif %} - {{ user.first_name }} - {{ user.last_name }} - {% if not hide_username %} + +{% if user.full_name %} + {{ user.full_name }} + {% if include_username|default_if_none:True %} ({{ user.username }}) {% endif %} +{% else %} + {{ user.username }} +{% endif %} + +{% for badge in user.userbadge_set.all %} + {% include 'marketplace/components/user_badge.html' with badge=badge compact_display=True %} +{% endfor %} - {% for badge in user.userbadge_set.all %} - {% include 'marketplace/components/user_badge.html' with badge=badge compact_display=True %} - {% endfor %} {% if not hide_anchor %}{% endif %} diff --git a/src/marketplace/templates/marketplace/org_staff.html b/src/marketplace/templates/marketplace/org_staff.html index c5974cd..da917c5 100644 --- a/src/marketplace/templates/marketplace/org_staff.html +++ b/src/marketplace/templates/marketplace/org_staff.html @@ -15,7 +15,7 @@

Full name - {# Email address #} + Email address Role Member since {% if user_is_administrator %} @@ -28,7 +28,7 @@

{% for staff in organization_staff %} {% include 'marketplace/components/user_display.html' with user=staff.user %} - {# {{ staff.user.email }} #} + {{ staff.user.email }} {{ staff.get_role_display }} {{ staff.creation_date }} {% if user_is_administrator %} @@ -166,7 +166,7 @@

Organization membership requests

Full name - {# Email address #} + Email address Request date Status Resolution date @@ -176,7 +176,7 @@

Organization membership requests

{% for request in organization_requests %} {% include 'marketplace/components/user_display.html' with user=request.user %} - {# {{ request.user.email }} #} + {{ request.user.email }} {{ request.request_date }} {% endif %}

User: {% include 'marketplace/components/user_display.html' with user=organizationrole.user %}

- {#

Email: {{ organizationrole.user.email }}

#} +

Email: {{ organizationrole.user.email }}

+ {% csrf_token %} {% include 'marketplace/components/standard_form_fields.html' %} diff --git a/src/marketplace/templates/marketplace/org_staff_remove.html b/src/marketplace/templates/marketplace/org_staff_remove.html index c048719..7528195 100644 --- a/src/marketplace/templates/marketplace/org_staff_remove.html +++ b/src/marketplace/templates/marketplace/org_staff_remove.html @@ -10,8 +10,10 @@

Remove staff member {% endif %}

+

User: {% include 'marketplace/components/user_display.html' with user=organizationrole.user %}

- {#

Email: {{ organizationrole.user.email }}

#} +

Email: {{ organizationrole.user.email }}

+ {% csrf_token %} {% include 'marketplace/components/standard_form_fields.html' %} diff --git a/src/marketplace/templates/marketplace/org_staff_request_review.html b/src/marketplace/templates/marketplace/org_staff_request_review.html index 94bc628..c231435 100644 --- a/src/marketplace/templates/marketplace/org_staff_request_review.html +++ b/src/marketplace/templates/marketplace/org_staff_request_review.html @@ -12,8 +12,9 @@

Membership request review

application and accept or reject it.

User: {% include 'marketplace/components/user_display.html' with user=organizationmembershiprequest.user %}

- {% comment %}

Email addres: - {{ organizationmembershiprequest.user.email }}

{% endcomment %} +

Email: + {{ organizationmembershiprequest.user.email }} +

Request date: {{ organizationmembershiprequest.request_date }}

diff --git a/src/marketplace/templates/marketplace/proj_staff.html b/src/marketplace/templates/marketplace/proj_staff.html index 433c0e8..73314c7 100644 --- a/src/marketplace/templates/marketplace/proj_staff.html +++ b/src/marketplace/templates/marketplace/proj_staff.html @@ -13,7 +13,7 @@

Staff members

Full name - {# Email address #} + Email address Role {% if perm_staff_edit %} @@ -27,7 +27,7 @@

Staff members

{% for staff in project_staff %} {% include 'marketplace/components/user_display.html' with user=staff.user %} - {# {{ staff.user.email }} #} + {{ staff.user.email }} {{ staff.get_role_display }} {% if perm_staff_edit %} diff --git a/src/marketplace/templates/marketplace/proj_staff_edit.html b/src/marketplace/templates/marketplace/proj_staff_edit.html index 6cc5145..dfc58b5 100644 --- a/src/marketplace/templates/marketplace/proj_staff_edit.html +++ b/src/marketplace/templates/marketplace/proj_staff_edit.html @@ -5,7 +5,8 @@

Edit staff member

User: {% include 'marketplace/components/user_display.html' with user=projectrole.user %}

- {#

Email: {{ projectrole.user.email }}

#} +

Email: {{ projectrole.user.email }}

+ {% csrf_token %} {% include 'marketplace/components/standard_form_fields.html' %} diff --git a/src/marketplace/templates/marketplace/proj_staff_remove.html b/src/marketplace/templates/marketplace/proj_staff_remove.html index a92d50b..b103f30 100644 --- a/src/marketplace/templates/marketplace/proj_staff_remove.html +++ b/src/marketplace/templates/marketplace/proj_staff_remove.html @@ -5,7 +5,8 @@

Remove staff member

User: {% include 'marketplace/components/user_display.html' with user=projectrole.user %}

- {#

Email: {{ projectrole.user.email }}

#} +

Email: {{ projectrole.user.email }}

+ {% csrf_token %} {% include 'marketplace/components/standard_form_fields.html' %} diff --git a/src/marketplace/templates/marketplace/proj_volunteer_application_review.html b/src/marketplace/templates/marketplace/proj_volunteer_application_review.html index 4e1fcdd..db37b66 100644 --- a/src/marketplace/templates/marketplace/proj_volunteer_application_review.html +++ b/src/marketplace/templates/marketplace/proj_volunteer_application_review.html @@ -6,9 +6,9 @@

Volunteer application

This person has applied to volunteer in your project.

-

User:{% include 'marketplace/components/user_display.html' with user=volunteerapplication.volunteer %}

- {#

Email addres:{{ volunteerapplication.volunteer.email }}

#} -

Application date: {{ volunteerapplication.application_date }}

+

User: {% include 'marketplace/components/user_display.html' with user=volunteerapplication.volunteer %}

+

Email: {{ volunteerapplication.volunteer.email }}

+

Application date: {{ volunteerapplication.application_date }}

Task: {{ volunteerapplication.task.name }}

Volunteer application letter

{{ volunteerapplication.volunteer_application_letter|markdown }}

diff --git a/src/marketplace/templates/marketplace/proj_volunteer_remove.html b/src/marketplace/templates/marketplace/proj_volunteer_remove.html index 34dea36..ba62cb0 100644 --- a/src/marketplace/templates/marketplace/proj_volunteer_remove.html +++ b/src/marketplace/templates/marketplace/proj_volunteer_remove.html @@ -4,7 +4,7 @@

Remove volunteer

User: {% include 'marketplace/components/user_display.html' with user=projecttaskrole.user %}

- {#

Email: {{ projecttaskrole.user.email }}

#} +

Email: {{ projecttaskrole.user.email }}

{% csrf_token %} {% include 'marketplace/components/standard_form_fields.html' %} diff --git a/src/marketplace/templates/marketplace/proj_volunteers.html b/src/marketplace/templates/marketplace/proj_volunteers.html index ef1b1ba..bc1dc14 100644 --- a/src/marketplace/templates/marketplace/proj_volunteers.html +++ b/src/marketplace/templates/marketplace/proj_volunteers.html @@ -1,5 +1,7 @@ {% extends 'marketplace/proj.html' %} +{% load text %} + {% block tabcontents %}

Project volunteers

@@ -13,7 +15,7 @@

Project volunteers

Full name - {# Email address #} + Email address Task Status {% if perm_volunteers_edit %} @@ -28,7 +30,7 @@

Project volunteers

{% for volunteer in volunteers %} {% include 'marketplace/components/user_display.html' with user=volunteer.user %} - {# {{ volunteer.user.email }} #} + {{ volunteer.user.email|wordbreak:'@' }} {{ volunteer.task.name }} {% if volunteer.task.is_completed %}Completed{% else %}Active{% endif %} @@ -66,7 +68,6 @@

Volunteer applications

Full name - {# Email address #} Project task Application date Status @@ -77,7 +78,6 @@

Volunteer applications

{% for application in volunteer_applications %} {% include 'marketplace/components/user_display.html' with user=application.volunteer %} - {# {{ application.volunteer.email }} #} {{ application.task.name }} {{ application.application_date }} diff --git a/src/marketplace/templates/marketplace/pwd_reset.html b/src/marketplace/templates/marketplace/pwd_reset.html index 5c3d8d8..d1faead 100644 --- a/src/marketplace/templates/marketplace/pwd_reset.html +++ b/src/marketplace/templates/marketplace/pwd_reset.html @@ -6,7 +6,7 @@

Reset your password

You can now reset your password; just type the reset code we sent you - to your email address and your new password.

+ to your email address and your new password.

{% csrf_token %} {% include 'marketplace/components/standard_form_fields.html' %} diff --git a/src/marketplace/templates/marketplace/user_profile.html b/src/marketplace/templates/marketplace/user_profile.html index d6def56..9cde3f8 100644 --- a/src/marketplace/templates/marketplace/user_profile.html +++ b/src/marketplace/templates/marketplace/user_profile.html @@ -1,5 +1,7 @@ {% extends 'marketplace/base.html' %} +{% load text %} + {% block pagecontents %} {% load markdown_deux_tags %} @@ -127,11 +129,19 @@

Volunteer highlights

Personal information
+ {% if userprofile.full_name %}
Full name: {{ userprofile.full_name }}
+ {% endif %} +
User name: {{ userprofile.username }}
- {#
Email address: {{ userprofile.email }}
#} - {#
Phone number: {{ userprofile.phone_number }}
#} - {% if userprofile.skype_name %}
Skype name: {{ userprofile.skype_name }}
{% endif %} + + {% if user.is_authenticated %} +
+ Email address: {{ userprofile.email|wordbreak:'@' }} +
+ {% if userprofile.phone_number %}
Phone number: {{ userprofile.phone_number }}
{% endif %} + {% if userprofile.skype_name %}
Skype name: {{ userprofile.skype_name }}
{% endif %} + {% endif %}
diff --git a/src/marketplace/templates/marketplace/volunteer_list.html b/src/marketplace/templates/marketplace/volunteer_list.html index c1f1ccc..e64e1eb 100644 --- a/src/marketplace/templates/marketplace/volunteer_list.html +++ b/src/marketplace/templates/marketplace/volunteer_list.html @@ -1,5 +1,7 @@ {% extends 'marketplace/base.html' %} +{% load text %} + {% block pagecontents %} {% if leaderboards %} @@ -67,15 +69,15 @@

Filter

User - {# Email address #} + {% if user.is_authenticated %}Email address{% endif %} Member since {% for volunteer in volunteer_list %} - {% include 'marketplace/components/user_display.html' with user=volunteer.user hide_username=True %} - {# {{ volunteer.user.email }} #} + {% include 'marketplace/components/user_display.html' with user=volunteer.user include_username=False %} + {% if user.is_authenticated %}{{ volunteer.user.email|wordbreak:'@' }}{% endif %} {{ volunteer.user.date_joined }} {% endfor %} diff --git a/src/marketplace/templatetags/include_redux.py b/src/marketplace/templatetags/include_redux.py new file mode 100644 index 0000000..7da95d0 --- /dev/null +++ b/src/marketplace/templatetags/include_redux.py @@ -0,0 +1,28 @@ +from django import template +from django.template import loader_tags + + +register = template.Library() + + +class IncludeStrippedNode(loader_tags.IncludeNode): + """IncludeNode which strips leading & trailing white space from + its rendering. + + """ + def render(self, context): + return super().render(context).strip() + + +@register.tag('include-stripped') +def do_include_stripped(parser, token): + """Include template -- exactly as "include" -- but with leading & + trailing white space stripped. + + Particularly useful for inclusion templates intended to render + compact node attribute values (rather than markup). + + """ + include_node = loader_tags.do_include(parser, token) + include_node.__class__ = IncludeStrippedNode + return include_node diff --git a/src/marketplace/templatetags/text.py b/src/marketplace/templatetags/text.py new file mode 100644 index 0000000..af5e39f --- /dev/null +++ b/src/marketplace/templatetags/text.py @@ -0,0 +1,17 @@ +from django import template +from django.template.defaultfilters import stringfilter +from django.utils.safestring import mark_safe + + +register = template.Library() + + +@register.filter +@stringfilter +def wordbreak(value, at): + """Insert `` after each occurence of `at`. + + Facilitates legible breaking of `value` across lines. + + """ + return mark_safe(value.replace(at, f'{at}')) diff --git a/src/marketplace/views/user.py b/src/marketplace/views/user.py index 927ab5e..5fd0ebb 100644 --- a/src/marketplace/views/user.py +++ b/src/marketplace/views/user.py @@ -270,7 +270,7 @@ def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['breadcrumb'] = build_breadcrumb([home_link(), users_link(), - my_profile_link(self.object.id, include_link=False) if self.object.id == self.request.user.id else (self.object.standard_display_name(), None)]) + my_profile_link(self.object.id, include_link=False) if self.object.id == self.request.user.id else (self.object.standard_display_name, None)]) project_tasks = ProjectTaskService.get_volunteer_all_tasks(self.request.user, self.object) context['project_tasks'] = paginate(self.request, project_tasks, request_key='project_tasks_page', page_size=15)