Make kfet.account.read.json accessible with GET

This commit is contained in:
Ludovic Stephan 2019-11-29 14:47:12 +01:00
parent 7df8a9ef6b
commit 091208b66c
2 changed files with 6 additions and 3 deletions

View file

@ -239,7 +239,11 @@ urlpatterns = [
# JSON urls
# -----
path("history.json", views.history_json, name="kfet.history.json"),
path("accounts/read.json", views.account_read_json, name="kfet.account.read.json"),
path(
"accounts/<trigramme:trigramme>/.json",
views.account_read_json,
name="kfet.account.read.json",
),
# -----
# Settings urls
# -----

View file

@ -905,8 +905,7 @@ def kpsul_get_settings(request):
@teamkfet_required
def account_read_json(request):
trigramme = request.POST.get("trigramme", "")
def account_read_json(request, trigramme):
account = get_object_or_404(Account, trigramme=trigramme)
data = {
"id": account.pk,