forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-10-12 15:50:13 +02:00
parent a75a95fcf8
commit aacbff8ecc
2 changed files with 4 additions and 4 deletions

View File

@ -532,8 +532,8 @@ def submit_post(v):
domain_obj = get_domain(domain)
if domain_obj:
if request.headers.get("Authorization"): return {"error":"ToS violation"}, 400
else: return render_template("submit.html", v=v, error="ToS Violation", title=title, url=url, body=request.values.get("body", "")), 400
if request.headers.get("Authorization"): return {"error":domain_obj.reason}, 400
else: return render_template("submit.html", v=v, error=domain_obj.reason, title=title, url=url, body=request.values.get("body", "")), 400
elif "twitter.com" in domain:
try: embed = requests.get("https://publish.twitter.com/oembed", params={"url":url, "omit_script":"t"}).json()["html"]
except: embed = None

View File

@ -30,8 +30,8 @@
<form action="/admin/banned_domains" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input name="domain" placeholder="Enter domain here.." class="form-control" required>
<input name="reason" placeholder="Enter ban reason here.." class="form-control">
<input id="ban-submit" type="submit" class="btn btn-primary" value="Toggle ban">
<input name="reason" placeholder="Enter ban reason here.." onchange="document.getElementById('ban-submit').disabled=false" class="form-control">
<input id="ban-submit" type="submit" class="btn btn-primary" value="Toggle ban" disabled>
</form>
{% endblock %}