Fix some deprecations and factor out a helper function (#387)

This commit is contained in:
FatherInire 2022-10-28 14:15:48 +11:00 committed by GitHub
parent 4bdfe28a35
commit b46ada9f72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 59 additions and 44 deletions

View file

@ -5,6 +5,7 @@ import math
from files.classes.views import ViewerRelationship
from files.helpers.alerts import *
from files.helpers.sanitize import *
from files.helpers.strings import sql_ilike_clean
from files.helpers.const import *
from files.helpers.assetcache import assetcache_path
from files.mail import *
@ -736,7 +737,7 @@ def api_is_available(name):
if len(name)<3 or len(name)>25:
return {name:False}
name2 = name.replace('\\', '').replace('_','\_').replace('%','')
name2 = sql_ilike_clean(name)
x= g.db.query(User).filter(
or_(