Appel le bon url() pour les recherches
authorPA Parent <paparent@paparent.me>
Fri, 22 Jul 2011 18:05:20 +0000 (14:05 -0400)
committerPA Parent <paparent@paparent.me>
Fri, 22 Jul 2011 18:05:20 +0000 (14:05 -0400)
auf_savoirs_en_partage/savoirs/models.py

index 8a4c893..7e66dac 100644 (file)
@@ -816,6 +816,11 @@ class Search(models.Model):
         )
 
     def url(self):
+
+        if self.content_type.model != 'search':
+            obj = self.content_type.get_object_for_this_type(pk=self.pk)
+            return obj.url()
+
         url = ''
         if self.discipline:
             url += '/discipline/%d' % self.discipline.id