forked from rDrama/rDrama
fix entry_url for hole art
parent
903488830b
commit
e483315173
|
@ -116,12 +116,14 @@ def approve_art(v, id):
|
||||||
abort(404, "Hole not found!")
|
abort(404, "Hole not found!")
|
||||||
|
|
||||||
filename = f'/images/{time.time()}'.replace('.','') + '.webp'
|
filename = f'/images/{time.time()}'.replace('.','') + '.webp'
|
||||||
|
entry_url = SITE_FULL_IMAGES + filename
|
||||||
if entry.kind == "sidebar":
|
if entry.kind == "sidebar":
|
||||||
hole.sidebarurls.append(f"{SITE_FULL_IMAGES}{filename}")
|
hole.sidebarurls.append(f"{SITE_FULL_IMAGES}{filename}")
|
||||||
else:
|
else:
|
||||||
hole.bannerurls.append(f"{SITE_FULL_IMAGES}{filename}")
|
hole.bannerurls.append(f"{SITE_FULL_IMAGES}{filename}")
|
||||||
else:
|
else:
|
||||||
filename = f"files/assets/images/{SITE_NAME}/{entry.location_kind}/{entry.id}.webp"
|
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)
|
copyfile(old, filename)
|
||||||
trim = (entry.kind == 'sidebar')
|
trim = (entry.kind == 'sidebar')
|
||||||
|
@ -133,8 +135,6 @@ def approve_art(v, id):
|
||||||
entry.author_id = author.id
|
entry.author_id = author.id
|
||||||
g.db.add(entry)
|
g.db.add(entry)
|
||||||
|
|
||||||
entry_url = f"{SITE_FULL_IMAGES}/i/{SITE_NAME}/{entry.location_kind}/{entry.id}.webp"
|
|
||||||
|
|
||||||
if v.id != author.id:
|
if v.id != author.id:
|
||||||
msg = f"@{v.username} (a site admin) has approved a {entry.formatted_kind} you made:\n{entry_url}"
|
msg = f"@{v.username} (a site admin) has approved a {entry.formatted_kind} you made:\n{entry_url}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue