gfd
This commit is contained in:
parent
1159275306
commit
c06f2b3625
2 changed files with 4 additions and 4 deletions
|
@ -532,8 +532,8 @@ def submit_post(v):
|
||||||
|
|
||||||
domain_obj = get_domain(domain)
|
domain_obj = get_domain(domain)
|
||||||
if domain_obj:
|
if domain_obj:
|
||||||
if request.headers.get("Authorization"): return {"error":"ToS violation"}, 400
|
if request.headers.get("Authorization"): return {"error":domain_obj.reason}, 400
|
||||||
else: return render_template("submit.html", v=v, error="ToS Violation", title=title, url=url, body=request.values.get("body", "")), 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:
|
elif "twitter.com" in domain:
|
||||||
try: embed = requests.get("https://publish.twitter.com/oembed", params={"url":url, "omit_script":"t"}).json()["html"]
|
try: embed = requests.get("https://publish.twitter.com/oembed", params={"url":url, "omit_script":"t"}).json()["html"]
|
||||||
except: embed = None
|
except: embed = None
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
<form action="/admin/banned_domains" method="post">
|
<form action="/admin/banned_domains" method="post">
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
<input name="domain" placeholder="Enter domain here.." class="form-control" required>
|
<input name="domain" placeholder="Enter domain here.." class="form-control" required>
|
||||||
<input name="reason" placeholder="Enter ban reason here.." class="form-control">
|
<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">
|
<input id="ban-submit" type="submit" class="btn btn-primary" value="Toggle ban" disabled>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue