fix 500 error on posting

master
Aevann1 2022-07-08 14:40:07 +02:00
parent a4b2a69689
commit c23366843e
2 changed files with 5 additions and 4 deletions

View File

@ -5,6 +5,7 @@ from files.helpers.const import *
from files.helpers.get import * from files.helpers.get import *
from files.helpers.sanitize import * from files.helpers.sanitize import *
import random import random
from urllib.parse import quote
if SITE_NAME == 'PCM': snappyquotes = [] if SITE_NAME == 'PCM': snappyquotes = []
else: snappyquotes = [f':#{x}:' for x in marseys_const2] else: snappyquotes = [f':#{x}:' for x in marseys_const2]
@ -33,6 +34,10 @@ def badge_grant(user, badge_id, description=None, url=None):
f"![]({badge.path})\n\n{badge.name}") f"![]({badge.path})\n\n{badge.name}")
def archiveorg(url):
try: requests.get(f'https://web.archive.org/save/{url}', headers={'User-Agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'}, timeout=100)
except: pass
def execute_snappy(post, v): def execute_snappy(post, v):
snappy = get_account(SNAPPY_ID) snappy = get_account(SNAPPY_ID)

View File

@ -510,10 +510,6 @@ def edit_post(pid, v):
return redirect(p.permalink) return redirect(p.permalink)
def archiveorg(url):
try: requests.get(f'https://web.archive.org/save/{url}', headers={'User-Agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'}, timeout=100)
except: pass
def thumbnail_thread(pid): def thumbnail_thread(pid):