adjust attachment path

This commit is contained in:
Your Name 2023-01-08 22:45:01 -05:00
parent afd058f640
commit febd3f2cac
3 changed files with 10 additions and 4 deletions

View file

@ -16,7 +16,7 @@ def resource_cover_path(resource, filename):
+ "."
+ filename.split(".")[-1]
)
return "item/" + resource.id_type + "/" + fn
return "item/" + fn
def item_cover_path(item, filename):
@ -26,4 +26,4 @@ def item_cover_path(item, filename):
+ "."
+ filename.split(".")[-1]
)
return "item/" + item.category + "/" + fn
return "item/" + fn

View file

@ -57,7 +57,14 @@ class Command(BaseCommand):
pg = Paginator(qs.order_by("id"), BATCH_SIZE)
for p in tqdm(pg.page_range):
items = list(
map(lambda o: Indexer.obj_to_dict(o), pg.get_page(p).object_list)
map(
lambda o: Indexer.obj_to_dict(o),
[
x
for x in pg.get_page(p).object_list
if x.__class__ != CatalogCollection
],
)
)
if items:
Indexer.replace_batch(items)

View file

@ -69,7 +69,6 @@ def retrieve(request, item_path, item_uuid):
if request.user.is_authenticated:
visible = query_visible(request.user)
mark = Mark(request.user, item)
_logger.info(mark.rating)
review = mark.review
collection_list = (
item.collections.all()