summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Fretin <vincent.fretin@gmail.com>2013-03-08 12:14:34 (GMT)
committerVincent Fretin <vincent.fretin@gmail.com>2013-03-08 12:14:54 (GMT)
commitfe09814281bb46c246e1e5a8a5ec6c99ea286e15 (patch)
tree6668eaf7c199bdada5ed776008f278536c87c592
parentc3f50dc5fc959644a19626e47117be0859825563 (diff)
downloadcollective.contact.widget-fe09814281bb46c246e1e5a8a5ec6c99ea286e15.zip
collective.contact.widget-fe09814281bb46c246e1e5a8a5ec6c99ea286e15.tar.gz
collective.contact.widget-fe09814281bb46c246e1e5a8a5ec6c99ea286e15.tar.bz2
Don't call tokenToUrl if value is --NOVALUE--
-rw-r--r--CHANGES.rst3
-rw-r--r--src/collective/contact/widget/templates/checkbox_input.pt2
-rw-r--r--src/collective/contact/widget/templates/radio_input.pt2
-rw-r--r--src/collective/contact/widget/widgets.py2
4 files changed, 6 insertions, 3 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index df917bf..1689a2a 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -5,7 +5,8 @@ Changelog
1.0 (unreleased)
----------------
-- Nothing changed yet.
+- Don't call tokenToUrl if value is --NOVALUE--.
+ [vincentfretin]
0.10 (2013-03-07)
diff --git a/src/collective/contact/widget/templates/checkbox_input.pt b/src/collective/contact/widget/templates/checkbox_input.pt
index 50ef1c2..b3efd27 100644
--- a/src/collective/contact/widget/templates/checkbox_input.pt
+++ b/src/collective/contact/widget/templates/checkbox_input.pt
@@ -41,7 +41,7 @@
class="link-tooltip"
target="_new"
tal:define="url python:view.tokenToUrl(item['value'])"
- tal:omit-tag="python:item['value'] == '--NOVALUE--' or not url"
+ tal:omit-tag="not:url"
tal:attributes="href url"
href="">Label</a></span>
</label>
diff --git a/src/collective/contact/widget/templates/radio_input.pt b/src/collective/contact/widget/templates/radio_input.pt
index 5af8ac7..9f2671c 100644
--- a/src/collective/contact/widget/templates/radio_input.pt
+++ b/src/collective/contact/widget/templates/radio_input.pt
@@ -41,7 +41,7 @@
class="link-tooltip"
target="_new"
tal:define="url python:view.tokenToUrl(item['value'])"
- tal:omit-tag="python:item['value'] == '--NOVALUE--' or not url"
+ tal:omit-tag="not:url"
tal:attributes="href url"
href="">Label</a></span>
</label>
diff --git a/src/collective/contact/widget/widgets.py b/src/collective/contact/widget/widgets.py
index 20ce363..f82fb43 100644
--- a/src/collective/contact/widget/widgets.py
+++ b/src/collective/contact/widget/widgets.py
@@ -173,6 +173,8 @@ function (event, data, formatted) {
"""
def tokenToUrl(self, token):
+ if token == "--NOVALUE--":
+ return ""
return self.bound_source.tokenToUrl(token)
def render(self):