def GET(self, **kwargs) -> str: # pylint: disable=invalid-name,no-self-use """GET Function""" location = kwargs.get("location", None) self._check_user() self.__check_for_blocked_locations(location) value = CONFIG.find_and_get(location) return self._return_data( "config", "Get CONFIG Option", True, location=location, setting=value, )
def POST(self, **kwargs) -> str: """POST Function""" location = kwargs.get("location", None) body = self._get_request_body() self._check_user() self.__check_for_blocked_locations(location) value = CONFIG.find_and_get(location) CONFIG.find_and_set(location, body["value"]) return self._return_data( "config", "set CONFIG Option", True, location=location, before=value, after=body["value"], )