From aa03a13ac3a10700981b211b007db9bb5f5291e0 Mon Sep 17 00:00:00 2001
From: Vishal
Date: Fri, 8 Sep 2017 16:04:45 +0530
Subject: [PATCH 1/2] [new] Shows bounty creator information
---
.../erpnext_foundation/doctype/bounty/templates/bounty.html | 1 +
.../doctype/bounty/templates/bounty_row.html | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/foundation/erpnext_foundation/doctype/bounty/templates/bounty.html b/foundation/erpnext_foundation/doctype/bounty/templates/bounty.html
index 36a25dc0..7e869839 100644
--- a/foundation/erpnext_foundation/doctype/bounty/templates/bounty.html
+++ b/foundation/erpnext_foundation/doctype/bounty/templates/bounty.html
@@ -107,6 +107,7 @@
About this feature
{{doc.description}}
+ Bounty created by {{ doc.owner }}
Bounties FAQ
diff --git a/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html b/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html
index 04b90e94..1835ba6a 100644
--- a/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html
+++ b/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html
@@ -16,8 +16,7 @@
{{ comments }}
{% endif %}
- {% set paid_backers = get_paid_backers(doc.bounty_backer) %}
- {% if paid_backers|len > 0 %}
+ {% if no_of_backers|len > 0 %}
{{ paid_backers|len }}
{% if paid_backers|len > 1 %}
From 8f3b5e93d081ea0efa37099fca0a38ae4ac6a725 Mon Sep 17 00:00:00 2001
From: Vishal
Date: Fri, 8 Sep 2017 16:40:19 +0530
Subject: [PATCH 2/2] "[fix] NoneType not iterable at get_paid_backers in
bounty.py"
---
foundation/erpnext_foundation/doctype/bounty/bounty.py | 5 ++++-
.../doctype/bounty/templates/bounty_row.html | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/foundation/erpnext_foundation/doctype/bounty/bounty.py b/foundation/erpnext_foundation/doctype/bounty/bounty.py
index 9e2b8d6b..a88c44fb 100644
--- a/foundation/erpnext_foundation/doctype/bounty/bounty.py
+++ b/foundation/erpnext_foundation/doctype/bounty/bounty.py
@@ -80,4 +80,7 @@ def get_list_context(context):
context.get_paid_backers = get_paid_backers
def get_paid_backers(backers):
- return [backer for backer in backers if backer.paid]
\ No newline at end of file
+ if backers:
+ return [backer for backer in backers if backer.paid]
+ else:
+ return 0
\ No newline at end of file
diff --git a/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html b/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html
index 1835ba6a..0d846e3b 100644
--- a/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html
+++ b/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html
@@ -16,7 +16,8 @@
{{ comments }}
{% endif %}
- {% if no_of_backers|len > 0 %}
+ {% set paid_backers = get_paid_backers(doc.bounty_backer) %}
+ {% if paid_backers and paid_backers|len > 0 %}
{{ paid_backers|len }}
{% if paid_backers|len > 1 %}