From fd422657d0a78829e41a11bc763e6a53c1470949 Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Sun, 6 Jan 2019 15:23:54 -0600 Subject: [PATCH] Updated docs and fixed settings api key issue --- api/commands.py | 5 ++++- api/views.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/commands.py b/api/commands.py index 8fea7d6..7ad305e 100644 --- a/api/commands.py +++ b/api/commands.py @@ -420,7 +420,8 @@ def restock(item_name, shop_name=None, discord_uuid=None, mc_uuid=None): :param shop_name: Shop the item is in, can be none if the only one location is owned by the user :param discord_uuid: Discord UUID :param mc_uuid: Minecraft UUID - :return: + :return: List of items updated + :help: Restocks items matching the item name in your shop ''' owner = get_player(discord_uuid, mc_uuid) shop = get_location(owner, shop_name, Shop) @@ -430,3 +431,5 @@ def restock(item_name, shop_name=None, discord_uuid=None, mc_uuid=None): for item in items: item.date_restocked = datetime.datetime.now() item.save() + + return objects_list_to_json(items) diff --git a/api/views.py b/api/views.py index f323aae..82a5b55 100644 --- a/api/views.py +++ b/api/views.py @@ -61,7 +61,7 @@ class CommandAPI(View): class SettingsAPI(View): def get(self, request): - if check_token(request, command_perm=True): + if check_token(request.GET, commands_perm=True): response = { "BOT_PREFIX": getattr(settings, 'GEOFFREY_BOT_PREFIX', '?'), "ERROR_USERS": getattr(settings, 'GEOFFREY__BOT_ERROR_USERS', []),