- if 'tags' not in data and user.is_authenticated():
- data['tags'] = ', '.join(t.name for t in obj.tags.filter(category='set', user=user).iterator() if t.name)
+ if 'tags' not in data and user.is_authenticated:
+ data['tags'] = ', '.join(
+ obj.tags.filter(category='set', user=user).exclude(name__in=(None, '')).values_list('name', flat=True))