diff --git a/catalog/jobs/discover.py b/catalog/jobs/discover.py index 5abfe6cf..ddf11d28 100644 --- a/catalog/jobs/discover.py +++ b/catalog/jobs/discover.py @@ -17,7 +17,7 @@ MIN_DAYS_FOR_PERIOD = 6 @JobManager.register class DiscoverGenerator(BaseJob): - interval = timedelta(hours=3) + interval = timedelta(hours=2) def get_popular_marked_item_ids(self, category, days, exisiting_ids): item_ids = [ diff --git a/mastodon/api.py b/mastodon/api.py index f3ed4249..2307f90c 100644 --- a/mastodon/api.py +++ b/mastodon/api.py @@ -498,9 +498,10 @@ def share_mark(mark): if user.preference.mastodon_append_tag else "" ) + site = MastodonApplication.objects.filter(domain_name=user.mastodon_site).first() stars = rating_to_emoji( mark.rating_grade, - MastodonApplication.objects.get(domain_name=user.mastodon_site).star_mode, + site.star_mode if site else 0, ) content = f"{mark.action_label}《{mark.item.display_title}》{stars}\n{mark.item.absolute_url}\n{mark.comment_text or ''}{tags}" update_id = None # get_status_id_by_url(mark.shared_link) diff --git a/mastodon/jobs.py b/mastodon/jobs.py index 8f7703c0..efc5fdbd 100644 --- a/mastodon/jobs.py +++ b/mastodon/jobs.py @@ -11,6 +11,7 @@ from mastodon.models import MastodonApplication @JobManager.register class MastodonSiteCheck(BaseJob): + interval = timedelta(days=1) max_unreachable_days = 31 def run(self): diff --git a/social/templates/feed_data.html b/social/templates/feed_data.html index 5c458205..0c313689 100644 --- a/social/templates/feed_data.html +++ b/social/templates/feed_data.html @@ -24,7 +24,7 @@ {{ activity.owner.display_name }} - {{ activity.owner.handler }} + {{ activity.owner.full_handle }} {% with "activity/"|add:activity.template|add:".html" as template %} diff --git a/takahe/utils.py b/takahe/utils.py index 159762f6..b3f299c0 100644 --- a/takahe/utils.py +++ b/takahe/utils.py @@ -217,7 +217,7 @@ class Takahe: @staticmethod def get_following_request_ids(identity_pk: int): targets = Follow.objects.filter( - source_id=identity_pk, state="pending_approval" + source_id=identity_pk, state__in=["unrequested", "pending_approval"] ).values_list("target", flat=True) return list(targets)