Commits

Jeffrey Gelens committed 43174d9

Check for right import

  • Participants
  • Parent commits b7eef61

Comments (0)

Files changed (1)

File bricks/templatetags/bricks.py

     def get_queryset(self, context):
         brick = models.get_model("bricks", self.model)
 
+        if brick is None:
+            raise ImportError("No such model '%s'" % self.model)
+
         return brick.objects.filter(
             Q(lang_code = context['LANGUAGE_CODE']) |
             Q(lang_code = "")
     def get_queryset(self, context):
         brick = models.get_model("bricks", self.model)
 
+        if brick is None:
+            raise ImportError("No such model '%s'" % self.model)
+
         return brick.objects.filter(
             Q(slug = self.slug),
             Q(lang_code = context['LANGUAGE_CODE']) |
         )
 
 
+
 class BrickAsNode(BrickSlugNode):
     """Gets brick and stores in given context variable."""