Skip to content

Commit

Permalink
Refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayfulla committed Dec 25, 2023
1 parent 9aaac8f commit de3afea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
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 __getitem__(self, item):
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

0 comments on commit de3afea

Please sign in to comment.