From aed140e46a0b473bfadf649afdddc2406b4bbbda Mon Sep 17 00:00:00 2001 From: dglemos Date: Tue, 12 Nov 2024 18:44:10 +0000 Subject: [PATCH] Returns user name --- .../gene2phenotype_app/serializers/locus_genotype_disease.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gene2phenotype_project/gene2phenotype_app/serializers/locus_genotype_disease.py b/gene2phenotype_project/gene2phenotype_app/serializers/locus_genotype_disease.py index f8a3e2df..5e447916 100644 --- a/gene2phenotype_project/gene2phenotype_app/serializers/locus_genotype_disease.py +++ b/gene2phenotype_project/gene2phenotype_app/serializers/locus_genotype_disease.py @@ -234,6 +234,9 @@ def get_comments(self, id): for comment in lgd_comments: text = { 'text':comment.comment, 'date':comment.date } + # authenticated users can have access to the user name + if authenticated_user == 1: + text['user'] = f"{comment.user.first_name} {comment.user.last_name}" data.append(text) return data