def buy_share(request): user = request.user if not user.is_superuser and not is_user_financier(user): return JsonResponse({'success': False, 'error': 'Недостаточно прав'}) response = fetch_buy_share_response(request) return JsonResponse(response)
def give_money(request): user = request.user if not user.is_superuser and not is_user_financier(user): return JsonResponse({'success': False, 'error': 'Недостаточно прав'}) response = fetch_transfer_money_response(request, give_money=True) return JsonResponse(response)
def exchange_rates(request): user = request.user if not user.is_superuser and not is_user_financier(user): return JsonResponse({'success': False, 'error': 'Недостаточно прав'}) serialized_rates = get_exchange_rates() return JsonResponse(serialized_rates, safe=False)