Skip to content

Commit

Permalink
Use regular expression to clean comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dglemos committed Feb 20, 2025
1 parent 382546b commit 4458d53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gene2phenotype_project/gene2phenotype_app/views/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.db.models import Q
import csv, gzip, tempfile, os
from datetime import datetime
import re

from gene2phenotype_app.models import (Panel, User, LocusGenotypeDisease,
LGDVariantType, LGDVariantGenccConsequence,
Expand Down Expand Up @@ -364,7 +365,7 @@ def PanelDownload(request, name):
).select_related('lgd__id').values('lgd__id', 'comment')

for data in queryset_lgd_comment:
comment = data['comment'].strip()
comment = re.sub(r'[\n\r]+', '', data['comment'])
if data['lgd__id'] not in lgd_comments:
lgd_comments[data['lgd__id']] = [comment]
else:
Expand Down

0 comments on commit 4458d53

Please sign in to comment.