forked from DGNum/gestioCOF
Make kfet.account.read.json
accessible with GET
This commit is contained in:
parent
7df8a9ef6b
commit
091208b66c
2 changed files with 6 additions and 3 deletions
|
@ -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
|
||||
# -----
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue