diff --git a/mastodon/api.py b/mastodon/api.py index bc9498ca..a09f57b8 100644 --- a/mastodon/api.py +++ b/mastodon/api.py @@ -206,7 +206,7 @@ def get_related_acct_list(site, token, api): response = get(url, headers={'User-Agent': 'NeoDB/1.0', 'Authorization': f'Bearer {token}'}) url = None if response.status_code == 200: - results.extend(map(lambda u: u['acct'] if u['acct'].find('@') != -1 else u['acct'] + site, response.json())) + results.extend(map(lambda u: (u['acct'] if u['acct'].find('@') != -1 else u['acct'] + site) if 'acct' in u else u, response.json())) if 'Link' in response.headers: for ls in response.headers['Link'].split(','): li = ls.strip().split(';') diff --git a/users/management/commands/refresh_mastodon.py b/users/management/commands/refresh_mastodon.py index c1609a4b..66995872 100644 --- a/users/management/commands/refresh_mastodon.py +++ b/users/management/commands/refresh_mastodon.py @@ -9,7 +9,7 @@ class Command(BaseCommand): def handle(self, *args, **options): count = 0 - for user in User.objects.filter(mastodon_last_refresh__lt=timezone.now() - timedelta(hours=24)): + for user in User.objects.filter(mastodon_last_refresh__lt=timezone.now() - timedelta(hours=5)): if user.mastodon_token: print(f"Refreshing {user}") if user.refresh_mastodon_data():