Activates user

def activate_user(self, data):
        """ Activates user """
        error = False
        user = self.database.users.find_one_and_update({"activate": data["activate"]}, {"$unset": {"activate": True}})
        if user is None:
            error = True
            msg = _("Invalid activation hash.")
        else:
            msg = _("You are now activated. You can proceed to login.")

        return msg, error