Fix emoji search after Marsey caching revert.

pull/31/head
Snakes 2022-11-28 22:17:28 -05:00
parent 261abe3161
commit 2304876348
Signed by: Snakes
GPG Key ID: E745A82778055C7E
2 changed files with 5 additions and 2 deletions

View File

@ -26,7 +26,7 @@ class Marsey(Base):
return self.tags.split(" ") + [self.name[len("marsey"):]] # type: ignore
def json(self):
return {
data = {
"name": self.name,
"author_id": self.author_id,
"submitter_id": self.submitter_id,
@ -35,3 +35,6 @@ class Marsey(Base):
"created_utc": self.created_utc,
"class": "Marsey",
}
if "author" in self.__dict__ and self.author:
data["author"] = self.author
return data

View File

@ -70,7 +70,7 @@ def get_marseys(db:scoped_session):
if not FEATURES['MARSEYS']: return []
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.author = author.username if FEATURES['ASSET_SUBMISSIONS'] else None
setattr(marsey, "class", "Marsey")
marseys.append(marsey)
return marseys