diff --git a/drama/classes/submission.py b/drama/classes/submission.py index de5b5d5fc..666c840a2 100644 --- a/drama/classes/submission.py +++ b/drama/classes/submission.py @@ -296,9 +296,8 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing): def has_award(self, kind): return bool(len([x for x in self.awards if x.kind == kind])) - @property - def voted(self): - return self._voted if "_voted" in self.__dict__ else 0 + def voted(self, v): + return v.votes.filter_by(submission_id=self.id).first().vote_type @property def title(self): diff --git a/drama/templates/submission_listing.html b/drama/templates/submission_listing.html index 5d553a2b5..02359401d 100644 --- a/drama/templates/submission_listing.html +++ b/drama/templates/submission_listing.html @@ -14,9 +14,9 @@ {% set score=ups-downs %} {% if v %} -{% set voted= p.voted %} + {% set voted= p.voted(v) %} {% else %} -{% set voted=-2 %} + {% set voted=-2 %} {% endif %}