forked from MarseyWorld/MarseyWorld
fdfd
parent
bdb26bcbc1
commit
51aea98f08
|
@ -56,7 +56,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
|
|||
backref="submissions")
|
||||
domain_ref = Column(Integer, ForeignKey("domains.id"))
|
||||
domain_obj = relationship("Domain")
|
||||
flags = relationship("Flag", lazy="dynamic").order_by(Flag.created_utc).all()
|
||||
flags = relationship("Flag", lazy="dynamic")
|
||||
is_approved = Column(Integer, ForeignKey("users.id"), default=0)
|
||||
over_18 = Column(Boolean, default=False)
|
||||
author = relationship(
|
||||
|
@ -419,7 +419,12 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
|
|||
@property
|
||||
@lazy
|
||||
def active_flags(self):
|
||||
return len(self.flags)
|
||||
return self.flags.count()
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def ordered_flags(self):
|
||||
return self.flags.order_by(Flag.created_utc).all()
|
||||
|
||||
|
||||
class SaveRelationship(Base, Stndrd):
|
||||
|
|
|
@ -489,7 +489,7 @@
|
|||
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
||||
<pre></pre>
|
||||
<ul style="padding-left:20px; margin-bottom: 0;">
|
||||
{% for f in p.flags %}
|
||||
{% for f in p.ordered_flags %}
|
||||
<li><a href="{{f.user.url}}">@{{f.user.username}}</a>: {{f.reason}}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -373,7 +373,7 @@
|
|||
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
||||
<pre></pre>
|
||||
<ul style="padding-left:20px; margin-bottom: 0;">
|
||||
{% for f in p.flags %}
|
||||
{% for f in p.ordered_flags %}
|
||||
<li><a href="{{f.user.url}}">@{{f.user.username}}</a>: {{f.reason}}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue