diff --git a/django/background_task/templatetags/backgroundtask_tags.py b/django/background_task/templatetags/backgroundtask_tags.py index 267f055..1b7249d 100644 --- a/django/background_task/templatetags/backgroundtask_tags.py +++ b/django/background_task/templatetags/backgroundtask_tags.py @@ -5,5 +5,8 @@ register = template.Library() @register.simple_tag def is_label_id_in_queue(label_id): - return Task.objects.filter(task_name="finances.tasks.check_spent", - task_params__contains=label_id).exists() + try: + return Task.objects.filter(task_name="finances.tasks.check_spent", + task_params__contains=label_id).exists() + except: + return False diff --git a/django/templates/label_edit.html b/django/templates/label_edit.html index e56d94a..43a3607 100644 --- a/django/templates/label_edit.html +++ b/django/templates/label_edit.html @@ -120,7 +120,8 @@ {% endif %} - {% is_label_id_in_queue object.id as is_in_queue %} +{% comment %} +{% is_label_id_in_queue object.id as is_in_queue %} {% if is_in_queue %}
Output in queue! This output is currently in the processing queue. It will be checked shortly.
- {% else %} +{% else %} {% if object.type == "output" %} {% switch output.get_spent_status %} {% case "spent" %} @@ -162,9 +163,48 @@ {% endswitch %} {% endif %} {% endif %} +{% endcomment %} +{% is_label_id_in_queue object.id as is_in_queue %} +{% if is_in_queue %} +
+ Output in queue! This output is currently in the processing queue. It will be checked shortly. +
+{% else %} + {% if object.type == "output" %} + {% if output.get_spent_status == "spent" %} +
+ Output spent! Blockchain records indicate that this output has been spent in another transaction. +
+ {% elif output.get_spent_status == "unspent" %} +
+ Output unspent! Blockchain records indicate that this output has not been spent yet. +
+ {% elif output.get_spent_status == "unconfirmed" %} +
+
+ + +
+ Output unconfirmed! Blockchain records indicate that this output has not been confirmed yet. +
+ {% else %} +
+ Unknown status: The status of this output could not be determined. +
+ {% endif %} + {% endif %} +{% endif %} - +