def remove_state(request, user_profile, keys=REQ(validator=check_list(check_string), default=None)): # type: (HttpRequest, UserProfile, Optional[List[str]]) -> HttpResponse keys = keys or get_keys_in_bot_state(user_profile) try: remove_bot_state(user_profile, keys) except StateError as e: return json_error(str(e)) return json_success()
def remove(self, key: Text) -> None: remove_bot_state(self.user_profile, [key])
def remove(self, key): # type: (Text) -> None remove_bot_state(self.user_profile, key)