diff --git a/NearBeach/views/request_for_change_views.py b/NearBeach/views/request_for_change_views.py index f04ce917c..299b5db26 100644 --- a/NearBeach/views/request_for_change_views.py +++ b/NearBeach/views/request_for_change_views.py @@ -17,7 +17,7 @@ RequestForChangeGroupApproval, ListOfRFCStatus, ) -from django.db.models import Q +from django.db.models import Q, F from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseRedirect, JsonResponse from django.urls import reverse from django.template import loader @@ -67,12 +67,17 @@ def get_rfc_context(rfc_id): """ # Get data rfc_results = RequestForChange.objects.get(rfc_id=rfc_id) - rfc_change_lead = User.objects.filter(id=rfc_results.rfc_lead.id).values( + rfc_change_lead = User.objects.filter( + id=rfc_results.rfc_lead.id + ).annotate( + profile_picture=F('userprofilepicture__document_id__document_key') + ).values( "id", "email", "first_name", "last_name", "username", + "profile_picture", ) user_list = User.objects.filter( is_active=True, diff --git a/src/js/components/request_for_change/RfcInformation.vue b/src/js/components/request_for_change/RfcInformation.vue index 5daf85db6..320bdc921 100644 --- a/src/js/components/request_for_change/RfcInformation.vue +++ b/src/js/components/request_for_change/RfcInformation.vue @@ -127,7 +127,7 @@ default profile @@ -431,6 +431,14 @@ //Send data this.sendUpdate(data_to_send); }, + getProfilePicture(profile_picture) { + //If customer profile is blank - return default picture + if (profile_picture === "" || profile_picture === null || profile_picture === undefined) { + return `${this.staticUrl}/NearBeach/images/placeholder/product_tour.svg`; + } + + return `${this.rootUrl}private/${profile_picture}`; + }, getStatus() { return this.rfcStatusDict[this.rfcResults[0].fields.rfc_status]; },