Is locked?
        Checks locking and possibly unlocks upon timeout if account was
        previously locked.

def is_locked(self):
        """
        Is locked?
        Checks locking and possibly unlocks upon timeout if account was
        previously locked.
        """
        now = datetime.datetime.utcnow()
        if self.locked_until and self.locked_until >= now:
            return True
        elif self.locked_until and self.locked_until < now:
            self.unlock_account()
            return False
        else:
            return False