forked from MarseyWorld/MarseyWorld
fix 500 error
parent
24b92d4f16
commit
6ade4f2093
|
@ -469,11 +469,9 @@ def submit_post(v, sub=None):
|
||||||
url = normalize_url(url)
|
url = normalize_url(url)
|
||||||
|
|
||||||
if v.admin_level < PERMS["IGNORE_DOMAIN_BAN"]:
|
if v.admin_level < PERMS["IGNORE_DOMAIN_BAN"]:
|
||||||
y = tldextract.extract(url).registered_domain + parsed_url.path
|
|
||||||
y = y.lower()
|
|
||||||
banned_domains = g.db.query(BannedDomain).all()
|
banned_domains = g.db.query(BannedDomain).all()
|
||||||
for x in banned_domains:
|
for x in banned_domains:
|
||||||
if y.startswith(x.domain):
|
if url.startswith(x.domain):
|
||||||
abort(400, f'Remove the banned link "{x.domain}" and try again!\nReason for link ban: "{x.reason}"')
|
abort(400, f'Remove the banned link "{x.domain}" and try again!\nReason for link ban: "{x.reason}"')
|
||||||
|
|
||||||
if "twitter.com" == domain:
|
if "twitter.com" == domain:
|
||||||
|
|
Loading…
Reference in New Issue