fix edge case for rss update
This commit is contained in:
parent
589b27bdae
commit
10df21d0ec
3 changed files with 11 additions and 1 deletions
|
@ -9,6 +9,7 @@ from django.conf import settings
|
|||
from django.core.cache import cache
|
||||
from django.core.validators import URLValidator
|
||||
from django.utils.timezone import make_aware
|
||||
from loguru import logger
|
||||
|
||||
from catalog.common import *
|
||||
from catalog.common.downloaders import (
|
||||
|
@ -111,6 +112,9 @@ class RSS(AbstractSite):
|
|||
|
||||
def scrape_additional_data(self):
|
||||
item = self.get_item()
|
||||
if not item:
|
||||
logger.error(f"item for RSS {self.url} not found")
|
||||
return
|
||||
feed = self.parse_feed_from_url(self.url)
|
||||
if not feed:
|
||||
return
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit edbe7cc6c8b6c513d5b9a5f8b5d12c15eadd680b
|
||||
Subproject commit b3880b8785803b9d695b27285fa781f3bf9230fb
|
|
@ -139,6 +139,12 @@ class Command(BaseCommand):
|
|||
u = User.objects.get(username=n, is_active=True)
|
||||
u.is_superuser = not u.is_superuser
|
||||
u.save()
|
||||
tu = u.identity.takahe_identity.users.all().first()
|
||||
if tu:
|
||||
tu.admin = u.is_superuser
|
||||
tu.save()
|
||||
else:
|
||||
self.stdout.write(f"no takahe user for {u}")
|
||||
self.stdout.write(f"update {u} superuser: {u.is_superuser}")
|
||||
|
||||
def staff(self, v):
|
||||
|
|
Loading…
Add table
Reference in a new issue