Skip to content

Commit

Permalink
Consistent member/user terminology
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
krestenlaust committed Apr 8, 2024
1 parent 88f1114 commit 1b2a2e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions stregsystem/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
re_path(r'^(?P<room_id>\d+)/user/(?P<member_id>\d+)/pay$', views.menu_userpay, name="userpay"),
re_path(r'^(?P<room_id>\d+)/user/(?P<member_id>\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"),
Expand Down
8 changes: 4 additions & 4 deletions stregsystem/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand Down

0 comments on commit 1b2a2e5

Please sign in to comment.