Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored #885

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions taggit/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ def __init__(self, through, model, instance, prefetch_cache_name, ordering=None)
self.model = model
self.instance = instance
self.prefetch_cache_name = prefetch_cache_name
if ordering:
self.ordering = ordering
else:
self.ordering = []
self.ordering = ordering if ordering else []

def is_cached(self, instance):
return self.prefetch_cache_name in instance._prefetched_objects_cache
Expand Down
4 changes: 2 additions & 2 deletions taggit/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
def __str__(self):
if self.pretty_print:
return json.dumps(self, sort_keys=True, indent=4, separators=(",", ": "))
else:
return json.dumps(self)

return json.dumps(self)

Check warning on line 38 in taggit/serializers.py

View check run for this annotation

Codecov / codecov/patch

taggit/serializers.py#L38

Added line #L38 was not covered by tests


class TagListSerializerField(serializers.ListField):
Expand Down
Loading