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
|
# JSON urls
|
||||||
# -----
|
# -----
|
||||||
path("history.json", views.history_json, name="kfet.history.json"),
|
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
|
# Settings urls
|
||||||
# -----
|
# -----
|
||||||
|
|
|
@ -905,8 +905,7 @@ def kpsul_get_settings(request):
|
||||||
|
|
||||||
|
|
||||||
@teamkfet_required
|
@teamkfet_required
|
||||||
def account_read_json(request):
|
def account_read_json(request, trigramme):
|
||||||
trigramme = request.POST.get("trigramme", "")
|
|
||||||
account = get_object_or_404(Account, trigramme=trigramme)
|
account = get_object_or_404(Account, trigramme=trigramme)
|
||||||
data = {
|
data = {
|
||||||
"id": account.pk,
|
"id": account.pk,
|
||||||
|
|
Loading…
Reference in a new issue