comparison src/lib/User.luan @ 61:389e5d8e5f8a default tip

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 06 Dec 2022 13:37:25 -0700
parents 02d8876dc41d
children
comparison
equal deleted inserted replaced
60:8b5b1bce7d6b 61:389e5d8e5f8a
102 if not Db.is_in_transaction() then 102 if not Db.is_in_transaction() then
103 local user = get_local_only(users_by_id,id) 103 local user = get_local_only(users_by_id,id)
104 if user ~= nil then return user end 104 if user ~= nil then return user end
105 end 105 end
106 local doc = Db.get_document("id:"..id) 106 local doc = Db.get_document("id:"..id)
107 return doc and from_doc(doc) 107 return doc and doc.type=="user" and from_doc(doc) or nil
108 end 108 end
109 User.get_by_id = get_by_id 109 User.get_by_id = get_by_id
110 110
111 function User.get_by_email(email) 111 function User.get_by_email(email)
112 local doc = Db.get_document("user_email:"..lucene_quote(email)) 112 local doc = Db.get_document("user_email:"..lucene_quote(email))