tags fix
parent
28c0fb6c73
commit
de90c24dba
|
@ -22,12 +22,15 @@ class Marsey(Base):
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"<Marsey(name={self.name})>"
|
return f"<Marsey(name={self.name})>"
|
||||||
|
|
||||||
|
def tags_list(self):
|
||||||
|
return self.tags.split(" ") + [self.name[len("marsey"):]] # type: ignore
|
||||||
|
|
||||||
def json(self):
|
def json(self):
|
||||||
return {
|
return {
|
||||||
"name": self.name,
|
"name": self.name,
|
||||||
"author_id": self.author_id,
|
"author_id": self.author_id,
|
||||||
"submitter_id": self.submitter_id,
|
"submitter_id": self.submitter_id,
|
||||||
"tags": self.tags.split(' '),
|
"tags": self.tags_list(),
|
||||||
"count": self.count,
|
"count": self.count,
|
||||||
"created_utc": self.created_utc
|
"created_utc": self.created_utc
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,6 @@ def get_marseys(db:scoped_session):
|
||||||
marseys = []
|
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()):
|
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.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")
|
setattr(marsey, "class", "Marsey")
|
||||||
marseys.append(marsey)
|
marseys.append(marsey)
|
||||||
return marseys
|
return marseys
|
||||||
|
|
Loading…
Reference in New Issue