Skip to content

Commit

Permalink
fixed issue with draft posts appearing in related, works but still ne…
Browse files Browse the repository at this point in the history
…eds more effort for cleaner execution
  • Loading branch information
montylounge committed Mar 27, 2011
1 parent e39cc27 commit 6c9163b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mingus/core/templatetags/tagging_related.py
Expand Up @@ -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 ''


Expand Down

0 comments on commit 6c9163b

Please sign in to comment.