Handle undefined datetime values

Closes #3288
* Check for undefined last_login and created_at values that occur
  on a User model for an invited user.