bugfix
This commit is contained in:
parent
55604a025e
commit
d669757df9
@ -29,6 +29,8 @@ class FileMgr:
|
|||||||
hashvalue = get_file_hash(realpath)
|
hashvalue = get_file_hash(realpath)
|
||||||
dbname = get_dbname()
|
dbname = get_dbname()
|
||||||
u = await get_session_userinfo(request)
|
u = await get_session_userinfo(request)
|
||||||
|
if u is None:
|
||||||
|
return False
|
||||||
db = DBPools()
|
db = DBPools()
|
||||||
async with db.sqlorContext(dbname) as sor:
|
async with db.sqlorContext(dbname) as sor:
|
||||||
recs = await sor.R('file',{'hashvalue': hashvalue})
|
recs = await sor.R('file',{'hashvalue': hashvalue})
|
||||||
@ -46,7 +48,7 @@ class FileMgr:
|
|||||||
"realpath": realpath,
|
"realpath": realpath,
|
||||||
"filetpye":params_kw.upfile.split('.')[-1].lower(),
|
"filetpye":params_kw.upfile.split('.')[-1].lower(),
|
||||||
"filesize":filesize,
|
"filesize":filesize,
|
||||||
"owner": u.userorgid,
|
"ownerid": u.userorgid,
|
||||||
"hashvalue": hashvalue
|
"hashvalue": hashvalue
|
||||||
}
|
}
|
||||||
await sor.C('file', ns)
|
await sor.C('file', ns)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user