Skip to content

Commit

Permalink
Fixing broken case detail page that has comments on svs. (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
stolpeo committed Feb 22, 2022
1 parent 667c81a commit 21a6e75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions svs/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import uuid as uuid_object
from datetime import datetime, timedelta

from django.utils.timezone import localtime

from varfish.utils import JSONField
from variants.helpers import get_engine
from bgjobs.models import BackgroundJob, JobModelMessageMixin
Expand Down Expand Up @@ -308,6 +310,9 @@ class _UserAnnotation(models.Model):
def get_variant_description(self):
return "({}) chr{}:{}-{}".format(self.sv_type, self.chromosome, self.start, self.end)

def get_date_created(self):
return localtime(self.date_created).strftime("%Y-%m-%d %H:%M")

class Meta:
abstract = True
indexes = (models.Index(fields=["case", "release", "bin"]),)
Expand Down
2 changes: 1 addition & 1 deletion variants/templates/variants/case/detail_annotation.html
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ <h4>
<div id="display-comment-{{ comment|keyvalue:"sodar_uuid" }}">
<span class="small text-muted">
<strong>{{ comment|keyvalue:"username" }}</strong>
{{ comment|keyvalue:"date_created"|date:"Y/m/d H:i" }}:
{{ comment|keyvalue:"date_created" }}:
</span>
<em>{{ comment|keyvalue:"text" }}</em>
{# {% if comment|keyvalue:"user" == request.user or request.user.is_superuser %}#}
Expand Down

0 comments on commit 21a6e75

Please sign in to comment.