From 20e41ad689bf31eed07a34cc537201d580248b7c Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 23 Sep 2018 14:57:25 -0700 Subject: [PATCH] Extremely minor touchups. --- etiquette/exceptions.py | 2 +- etiquette/objects.py | 2 +- frontends/etiquette_flask/etiquette_flask/decorators.py | 2 +- frontends/etiquette_flask/static/js/common.js | 5 ++--- frontends/etiquette_flask/templates/bookmarks.html | 5 +++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/etiquette/exceptions.py b/etiquette/exceptions.py index fac32af..88d13e8 100644 --- a/etiquette/exceptions.py +++ b/etiquette/exceptions.py @@ -113,7 +113,7 @@ class CantGroupSelf(EtiquetteException): error_message = 'Cannot group {} into itself.' class CantSynonymSelf(EtiquetteException): - error_message = 'Cannot apply synonym to self.' + error_message = 'Cannot make {} a synonym of itself.' class EasyBakeError(EtiquetteException): error_message = '{}' diff --git a/etiquette/objects.py b/etiquette/objects.py index c344821..b0851ce 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -1214,7 +1214,7 @@ class Tag(ObjectBase, GroupableMixin): synname = self.photodb.normalize_tagname(synname) if synname == self.name: - raise exceptions.CantSynonymSelf() + raise exceptions.CantSynonymSelf(self) self.photodb.assert_no_such_tag(name=synname) diff --git a/frontends/etiquette_flask/etiquette_flask/decorators.py b/frontends/etiquette_flask/etiquette_flask/decorators.py index e43762d..e82a9fc 100644 --- a/frontends/etiquette_flask/etiquette_flask/decorators.py +++ b/frontends/etiquette_flask/etiquette_flask/decorators.py @@ -10,7 +10,7 @@ from . import jsonify def catch_etiquette_exception(function): ''' If an EtiquetteException is raised, automatically catch it and convert it - into a response so that the user isn't receiving error 500. + into a json response so that the user isn't receiving error 500. ''' @functools.wraps(function) def wrapped(*args, **kwargs): diff --git a/frontends/etiquette_flask/static/js/common.js b/frontends/etiquette_flask/static/js/common.js index 2435454..8fa0249 100644 --- a/frontends/etiquette_flask/static/js/common.js +++ b/frontends/etiquette_flask/static/js/common.js @@ -12,9 +12,8 @@ function _request(method, url, callback) { if (callback != null) { - var text = request.responseText; var response = { - "data": JSON.parse(text), + "data": JSON.parse(request.responseText), "meta": {} }; response["meta"]["request_url"] = url; @@ -179,7 +178,7 @@ function init_button_with_confirm() delete button.dataset.promptClass; var button_confirm = document.createElement("button"); - button_confirm.innerText = button.dataset.confirm || button.innerText; + button_confirm.innerText = (button.dataset.confirm || button.innerText).trim(); button_confirm.className = button.dataset.confirmClass || ""; holder_stage2.appendChild(button_confirm); holder_stage2.appendChild(document.createTextNode(" ")); diff --git a/frontends/etiquette_flask/templates/bookmarks.html b/frontends/etiquette_flask/templates/bookmarks.html index e8f2615..7dafb55 100644 --- a/frontends/etiquette_flask/templates/bookmarks.html +++ b/frontends/etiquette_flask/templates/bookmarks.html @@ -10,7 +10,7 @@