Skip to content
Browse files

fixed issue with draft posts appearing in related, works but still ne…

…eds more effort for cleaner execution
  • Loading branch information...
1 parent e39cc27 commit 6c9163bee3946dbda954b0daaa611ab924f487af @montylounge montylounge committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 mingus/core/templatetags/tagging_related.py
View
8 mingus/core/templatetags/tagging_related.py
@@ -20,7 +20,13 @@ def render(self, context):
if param is None:
raise TemplateSyntaxError(_('tagged_get_related tag was given an invalid input: %s') % self.queryset_or_model)
- context[self.context_var] = TaggedItem.objects.get_related(self.obj.resolve(context), param, **self.kwargs)
+ objs = list(TaggedItem.objects.get_related(self.obj.resolve(context), param, **self.kwargs))
+ for obj in objs:
+ if hasattr(obj, 'status'):
+ if obj.status != 2:
+ objs.remove(obj)
+
+ context[self.context_var] = objs
return ''

0 comments on commit 6c9163b

Please sign in to comment.
Something went wrong with that request. Please try again.