@cronjobs.register
def generate_missing_share_links():
 document_ids = Document.objects.select_related('revision').filter(parent=None, share_link='', is_template=False, is_archived=False, category__in=settings.IA_DEFAULT_CATEGORIES).exclude(slug='', current_revision=None, html__startswith=REDIRECT_HTML).values_list('id', flat=True)
 tasks.add_short_links.delay(list(document_ids))

@ cronjobs . register def generate_missing_share_links ( ) : document_ids = Document . objects . select_related ( 'revision' ) . filter ( parent = None , share_link = '' , is_template = False , is_archived = False , category__in = settings . IA_DEFAULT_CATEGORIES ) . exclude ( slug = '' , current_revision = None , html__startswith = REDIRECT_HTML ) . values_list ( 'id' , flat = True ) tasks . add_short_links . delay ( list ( document_ids ) )
generate share links for documents that may be missing them .