Browse Source

Allow configurations not to set an url_namespace

Baptiste Jonglez 10 years ago
parent
commit
72e68cdcef
2 changed files with 2 additions and 2 deletions
  1. 1 1
      coin/configuration/models.py
  2. 1 1
      coin/members/templates/members/subscriptions.html

+ 1 - 1
coin/configuration/models.py

@@ -61,7 +61,7 @@ class Configuration(PolymorphicModel):
         celui définit dans la classe enfant dans url_namespace sinon
         par défaut utilise le nom de la classe en minuscule
         """
-        if self.url_namespace:
+        if hasattr(self, 'url_namespace') and self.url_namespace:
             return self.url_namespace
         else:
             return self.model_name().lower()

+ 1 - 1
coin/members/templates/members/subscriptions.html

@@ -22,7 +22,7 @@
             <td>{{ subscription.subscription_date }}</td>
             <td>{{ subscription.resign_date|default_if_none:"" }}</td>
             <td>{{ subscription.configuration.comment }}</td>
-            <td>{% if subscription.configuration %}<a class="cfglink" href="{% url subscription.configuration.get_url_namespace|add:":details" id=subscription.configuration.id %}"><i class="fa fa-cog"></i> Configuration</a>{% endif %}</td>
+            <td>{% if subscription.configuration and subscription.configuration.url_namespace %}<a class="cfglink" href="{% url subscription.configuration.get_url_namespace|add:":details" id=subscription.configuration.id %}"><i class="fa fa-cog"></i> Configuration</a>{% endif %}</td>
             
         </tr>
         {% endfor %}