Skip to content

Commit

Permalink
🐛 fix auto saving of feed (#490)
Browse files Browse the repository at this point in the history
* 🐛 fix auto saving of feed

* ✨ add isnull filter

* ✨ add case-insensitive filter
  • Loading branch information
itsthejoker committed May 18, 2023
1 parent 4aa10c2 commit d54b2a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions blossom/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ def save(self, *args: Any, skip_extras: bool = False, **kwargs: Any) -> None:
If `skip_extras` is set, then it should bypass everything that is not
simply "save the object to the db".
"""
super(Submission, self).save(*args, **kwargs)

if not self.feed:
self.feed = self.get_subreddit_name()

super(Submission, self).save(*args, **kwargs)

if not skip_extras:
if self.is_image and not self.has_ocr_transcription and not self.cannot_ocr:
# TODO: This is a great candidate for a basic queue system
Expand Down
2 changes: 1 addition & 1 deletion blossom/api/views/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class SubmissionViewSet(viewsets.ModelViewSet):
"content_url": ["exact", "isnull"],
"redis_id": ["exact", "isnull"],
"removed_from_queue": ["exact"],
"feed": ["exact"],
"feed": ["exact", "isnull", "iexact"],
}
ordering_fields = [
"id",
Expand Down

0 comments on commit d54b2a6

Please sign in to comment.