Fix database error when searching users

In the admin, when searching users, the database object
was referenced before assignment
Merge pull request #19 from camilotorresf/fixes

Fix database error when searching users