fix entry_url for hole art

master
Aevann 2024-04-11 21:11:14 +02:00
parent 903488830b
commit e483315173
1 changed files with 2 additions and 2 deletions

View File

@ -116,12 +116,14 @@ def approve_art(v, id):
abort(404, "Hole not found!")
filename = f'/images/{time.time()}'.replace('.','') + '.webp'
entry_url = SITE_FULL_IMAGES + filename
if entry.kind == "sidebar":
hole.sidebarurls.append(f"{SITE_FULL_IMAGES}{filename}")
else:
hole.bannerurls.append(f"{SITE_FULL_IMAGES}{filename}")
else:
filename = f"files/assets/images/{SITE_NAME}/{entry.location_kind}/{entry.id}.webp"
entry_url = f"{SITE_FULL_IMAGES}/i/{SITE_NAME}/{entry.location_kind}/{entry.id}.webp"
copyfile(old, filename)
trim = (entry.kind == 'sidebar')
@ -133,8 +135,6 @@ def approve_art(v, id):
entry.author_id = author.id
g.db.add(entry)
entry_url = f"{SITE_FULL_IMAGES}/i/{SITE_NAME}/{entry.location_kind}/{entry.id}.webp"
if v.id != author.id:
msg = f"@{v.username} (a site admin) has approved a {entry.formatted_kind} you made:\n{entry_url}"