discord: remove

This commit is contained in:
justcool393 2022-11-21 10:39:27 -08:00 committed by GitHub
parent dc50d4f1cc
commit 23e64d176d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 32 additions and 247 deletions

View file

@ -1,7 +1,6 @@
from __future__ import unicode_literals
from files.helpers.alerts import *
from files.helpers.sanitize import *
from files.helpers.discord import remove_user, set_nick
from files.helpers.const import *
from files.mail import *
from files.__main__ import app, cache, limiter
@ -10,7 +9,6 @@ from .front import frontlist
import os
from files.helpers.sanitize import filter_emojis_only
from files.helpers.strings import sql_ilike_clean
from files.helpers.discord import add_role
from shutil import copyfile
import requests
@ -604,28 +602,11 @@ def settings_unblock_user(v):
@app.get("/settings/apps")
@auth_required
def settings_apps(v):
return render_template("settings_apps.html", v=v)
@app.post("/settings/remove_discord")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@auth_required
def settings_remove_discord(v):
remove_user(v)
v.discord_id=None
g.db.add(v)
g.db.commit()
return redirect("/settings/profile")
@app.get("/settings/content")
@auth_required
def settings_content_get(v):
return render_template("settings_filters.html", v=v)
@app.post("/settings/name_change")
@ -663,11 +644,7 @@ def settings_name_change(v):
v.username=new_name
v.name_changed_utc=int(time.time())
set_nick(v, new_name)
g.db.add(v)
g.db.commit()
return redirect("/settings/profile")