diff --git a/kfet/static/kfet/js/kfet.api.js b/kfet/static/kfet/js/kfet.api.js
index bfadc4dd..dd5d011b 100644
--- a/kfet/static/kfet/js/kfet.api.js
+++ b/kfet/static/kfet/js/kfet.api.js
@@ -284,6 +284,11 @@ class Account extends APIModelObject {
return Urls['kfet.account.read'](trigramme_url);
}
+ static url_update_for(trigramme) {
+ var trigramme_url = encodeURIComponent(trigramme);
+ return Urls['kfet.account.update'](trigramme_url);
+ }
+
/**
* @default this.trigramme
*/
@@ -352,6 +357,10 @@ class Checkout extends APIModelObject {
return Urls['kfet.checkout.read'](api_pk);
}
+ static url_update_for(api_pk) {
+ return Urls['kfet.checkout.update'](api_pk);
+ }
+
/**
* @default {@link Formatters.CheckoutFormatter}
*/
diff --git a/kfet/static/kfet/js/kpsul.js b/kfet/static/kfet/js/kpsul.js
index f9aa8e23..c4052d73 100644
--- a/kfet/static/kfet/js/kpsul.js
+++ b/kfet/static/kfet/js/kpsul.js
@@ -36,8 +36,8 @@ class AccountManager {
this.search = new AccountSearch(this);
// buttons: search, read or create
- this.$buttons_container = this._$container.find('.buttons');
- this.buttons_templates = {
+ this._$buttons_container = this._$container.find('.buttons');
+ this._buttons_templates = {
create: template``,
read: template``,
search: template``,
@@ -65,16 +65,16 @@ class AccountManager {
var trigramme = this.selection.get();
if (trigramme.isValidTri()) {
var url = Account.url_create(trigramme);
- buttons = this.buttons_templates.create({url: url});
+ buttons = this._buttons_templates['create']({url: url});
} else { /* trigramme input is empty or invalid */
- buttons = this.buttons_templates.search();
+ buttons = this._buttons_templates['search']();
}
} else { /* an account is loaded */
var url = this.account.url_read;
- buttons = this.buttons_templates.read({url: url});
+ buttons = this._buttons_templates['read']({url: url});
}
- this.$buttons_container.html(buttons);
+ this._$buttons_container.html(buttons);
}
update(trigramme) {
@@ -261,8 +261,8 @@ class CheckoutManager {
this.laststatement = new Statement();
this.laststatement_display_prefix = '#checkout-last_statement_';
- this.$buttons_container = this._$container.find('.buttons');
- this.buttons_templates = {
+ this._$buttons_container = this._$container.find('.buttons');
+ this._buttons_templates = {
read: template``,
statement_create: template``,
}
@@ -327,12 +327,12 @@ class CheckoutManager {
var buttons = '';
if (!this.is_empty()) {
var url_newcheckout = Statement.url_create(this.checkout.id);
- buttons += this.buttons_templates.statement_create({
+ buttons += this._buttons_templates['statement_create']({
url: url_newcheckout});
var url_read = this.checkout.url_read;
- buttons += this.buttons_templates.read({url: url_read});
+ buttons += this._buttons_templates['read']({url: url_read});
}
- this.$buttons_container.html(buttons);
+ this._$buttons_container.html(buttons);
}
reset() {
diff --git a/kfet/views.py b/kfet/views.py
index cc69dcda..a2e4ca17 100644
--- a/kfet/views.py
+++ b/kfet/views.py
@@ -62,7 +62,6 @@ class JSONResponseMixin(object):
"""
Returns a JSON response, transforming 'context' to make the payload.
"""
- print(context)
return JsonResponse(
self.get_data(context),
**response_kwargs