diff --git a/filemgr/filemgr.py b/filemgr/filemgr.py index da7018e..65ea4fc 100644 --- a/filemgr/filemgr.py +++ b/filemgr/filemgr.py @@ -29,6 +29,8 @@ class FileMgr: hashvalue = get_file_hash(realpath) dbname = get_dbname() u = await get_session_userinfo(request) + if u is None: + return False db = DBPools() async with db.sqlorContext(dbname) as sor: recs = await sor.R('file',{'hashvalue': hashvalue}) @@ -46,7 +48,7 @@ class FileMgr: "realpath": realpath, "filetpye":params_kw.upfile.split('.')[-1].lower(), "filesize":filesize, - "owner": u.userorgid, + "ownerid": u.userorgid, "hashvalue": hashvalue } await sor.C('file', ns)