From 1b2a2e51f6ab366e250a76ec8b124779948788e6 Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Mon, 8 Apr 2024 12:38:54 +0200 Subject: [PATCH] Consistent member/user terminology There's an inconsistency in whether to call a member a user. Generally, users are the ones with admin access, while members are the customers. --- stregsystem/urls.py | 8 ++++---- stregsystem/views.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stregsystem/urls.py b/stregsystem/urls.py index 382e3254..9357bebd 100644 --- a/stregsystem/urls.py +++ b/stregsystem/urls.py @@ -30,11 +30,11 @@ re_path(r'^(?P\d+)/user/(?P\d+)/pay$', views.menu_userpay, name="userpay"), re_path(r'^(?P\d+)/user/(?P\d+)/rank$', views.menu_userrank, name="userrank"), re_path(r'^api/member/payment/qr$', views.qr_payment, name="payment_qr"), - re_path(r'^api/member/active$', views.check_user_active, name="active_member"), - re_path(r'^api/member/sales$', views.get_user_sales, name="get_user_sales"), + re_path(r'^api/member/active$', views.check_member_active, name="active_member"), + re_path(r'^api/member/sales$', views.get_member_sales, name="get_member_sales"), re_path(r'^api/member/get_id$', views.convert_username_to_id, name="get_id"), - re_path(r'^api/member/balance$', views.get_user_balance, name="get_user_balance"), - re_path(r'^api/member$', views.get_user_info, name="get_user_transactions"), + re_path(r'^api/member/balance$', views.get_member_balance, name="get_member_balance"), + re_path(r'^api/member$', views.get_member_info, name="get_member_info"), re_path(r'^api/products/named_products$', views.dump_named_items, name="named_products"), re_path(r'^api/products/active_products$', views.dump_active_items, name="active_products"), re_path(r'^api/products/category_mappings$', views.dump_product_category_mappings, name="product_mappings"), diff --git a/stregsystem/views.py b/stregsystem/views.py index ecd5874c..df56a079 100644 --- a/stregsystem/views.py +++ b/stregsystem/views.py @@ -504,7 +504,7 @@ def dump_active_items(request): return JsonResponse(items_dict, json_dumps_params={'ensure_ascii': False}) -def check_user_active(request): +def check_member_active(request): member_id = request.GET.get('member_id') or None if member_id is None: return HttpResponseBadRequest("Missing member_id") @@ -534,7 +534,7 @@ def dump_product_category_mappings(request): return JsonResponse({p.id: [(cat.id, cat.name) for cat in p.categories.all()] for p in Product.objects.all()}) -def get_user_sales(request): +def get_member_sales(request): member_id = request.GET.get('member_id') or None if member_id is None: return HttpResponseBadRequest("Missing member_id") @@ -547,7 +547,7 @@ def get_user_sales(request): ) -def get_user_balance(request): +def get_member_balance(request): member_id = request.GET.get('member_id') or None if member_id is None: return HttpResponseBadRequest("Missing member_id") @@ -560,7 +560,7 @@ def get_user_balance(request): return JsonResponse({'balance': member.balance}) -def get_user_info(request): +def get_member_info(request): member_id = str(request.GET.get('member_id')) or None if member_id is None or not member_id.isdigit(): return HttpResponseBadRequest("Missing or invalid member_id")