From 6fae8316d6179187bdc45622463d24449be47eb1 Mon Sep 17 00:00:00 2001 From: Arkadiusz Adamski Date: Mon, 8 Jun 2015 10:47:20 +0200 Subject: [PATCH] Fixed autocomplete widget's links. Links in autocomplete widget was broken after remove ``url`` property from model. --- src/ralph/ui/channels.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ralph/ui/channels.py b/src/ralph/ui/channels.py index 68ff8ae436..b302cd2f44 100644 --- a/src/ralph/ui/channels.py +++ b/src/ralph/ui/channels.py @@ -37,7 +37,12 @@ def get_result(self, obj): return obj.name def get_item_url(self, obj): - return getattr(obj, 'url', None) + url = None + try: + url = obj.get_absolute_url() + except AttributeError: + url = getattr(obj, 'url', None) + return url def format_match(self, obj): return self.format_item_display(obj)