Fixing validate_record function

Problem: The user was able to edit/sigup with emails that were already
registered.

Cause: The validate_record function was encrypting a empty password,
which return a non-empty value. This caused the wrong SQL Query to
execute and not find the UserID for a registered user.