domain_blocks parsing fix

This commit is contained in:
Your Name 2021-12-15 15:29:25 -05:00
parent 71755183c0
commit 565048cd09
2 changed files with 2 additions and 2 deletions

View file

@ -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(';')

View file

@ -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():