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

🐛 fix auto saving of feed #490

Merged
merged 3 commits into from
May 18, 2023
Merged
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
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
Loading