From b48af5062013b464b3ca08d89bc0e9a0ead181da Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 13 Feb 2023 17:50:46 +0000 Subject: [PATCH] Rename pairs to assets --- core/views/assets.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/core/views/assets.py b/core/views/assets.py index 55c8b04..5c4bb26 100644 --- a/core/views/assets.py +++ b/core/views/assets.py @@ -28,8 +28,8 @@ log = logs.get_logger(__name__) class AssetGroupList(LoginRequiredMixin, ObjectList): list_template = "partials/assetgroup-list.html" model = AssetGroup - page_title = "List of asset groups for restrictions. Linked to strategies." - page_subtitle = "Asset groups are collections of asset restrictions." + page_title = "List of asset groups for aggregations. Linked to strategies." + page_subtitle = "Asset groups are maps between currencies and their sentiment." list_url_name = "assetgroups" list_url_args = ["type"] @@ -165,18 +165,18 @@ class AssetGroupAPI(APIView): topic = request.data["topic"] print("YES TOPIC", topic) - new_pairs = [] - pair_split = topic.split(",") - if not pair_split: - log.error(f"Asset API {webhook_id} topic {topic} is not a pair") + new_assets = [] + assets_split = topic.split(",") + if not assets_split: + log.error(f"Asset API {webhook_id} topic {topic} is not an asset") return HttpResponse(status=status.HTTP_400_BAD_REQUEST) - for pair in pair_split: - if pair: - new_pairs.append(pair.strip()) + for asset in assets_split: + if asset: + new_assets.append(asset.strip()) else: - log.error(f"Asset API {webhook_id} pair {pair} is not a pair") + log.error(f"Asset API {webhook_id} asset {asset} is not an asset") return HttpResponse(status=status.HTTP_400_BAD_REQUEST) - print("YES PAIRS", new_pairs) + print("YES PAIRS", new_assets) # Check if we have lower/upper bounds if group.aggregation != "none": @@ -191,8 +191,8 @@ class AssetGroupAPI(APIView): ) print("YES AVG IS MATCH", is_match) - for pair in new_pairs: - group.allowed[pair] = is_match is True or None + for asset in new_assets: + group.allowed[asset] = is_match is True or None group.save() return HttpResponse(status=status.HTTP_200_OK)