pull/15/head
justcool393 2022-11-26 16:24:35 -06:00
parent 28c0fb6c73
commit de90c24dba
2 changed files with 4 additions and 2 deletions

View File

@ -22,12 +22,15 @@ class Marsey(Base):
def __repr__(self):
return f"<Marsey(name={self.name})>"
def tags_list(self):
return self.tags.split(" ") + [self.name[len("marsey"):]] # type: ignore
def json(self):
return {
"name": self.name,
"author_id": self.author_id,
"submitter_id": self.submitter_id,
"tags": self.tags.split(' '),
"tags": self.tags_list(),
"count": self.count,
"created_utc": self.created_utc
}

View File

@ -47,7 +47,6 @@ def get_marseys(db:scoped_session):
marseys = []
for marsey, author in db.query(Marsey, User).join(User, Marsey.author_id == User.id).filter(Marsey.submitter_id == None).order_by(Marsey.count.desc()):
marsey.author = author.username if FEATURES['ASSET_SUBMISSIONS'] or author == "anton-d" else None
marsey.tags = marsey.tags.split(" ") + [marsey.name[len("marsey"):]]
setattr(marsey, "class", "Marsey")
marseys.append(marsey)
return marseys