-Fixed the 500 error issue when installing new instance of ail when adding new trackers

-Fixed missing arguments
-Typo Fixed
This commit is contained in:
TonyJabbour 2021-09-30 13:37:12 +02:00
parent 52e422604a
commit 4b2e9f5cfb

View file

@ -83,7 +83,7 @@ def is_father(item_id):
def is_children(item_id): def is_children(item_id):
return r_serv_metadata.hexists('paste_metadata:{}'.format(item_id), 'father') return r_serv_metadata.hexists('paste_metadata:{}'.format(item_id), 'father')
def is_root_node(): def is_root_node(item_id):
if is_father(item_id) and not is_children(item_id): if is_father(item_id) and not is_children(item_id):
return True return True
else: else:
@ -131,8 +131,8 @@ def _delete_node(item_id):
# only if item isn't deleted # only if item isn't deleted
#if is_crawled(item_id): #if is_crawled(item_id):
# r_serv_metadata.hrem('paste_metadata:{}'.format(item_id), 'real_link') # r_serv_metadata.hrem('paste_metadata:{}'.format(item_id), 'real_link')
for chidren_id in get_item_children(item_id): for children_id in get_item_children(item_id):
r_serv_metadata.hdel('paste_metadata:{}'.format(chidren_id), 'father') r_serv_metadata.hdel('paste_metadata:{}'.format(children_id), 'father')
r_serv_metadata.delete('paste_children:{}'.format(item_id)) r_serv_metadata.delete('paste_children:{}'.format(item_id))
# delete regular # delete regular
@ -210,9 +210,12 @@ def _get_dir_source_name(directory, source_name=None, l_sources_name=set(), filt
def get_all_items_sources(filter_dir=False, r_list=False): def get_all_items_sources(filter_dir=False, r_list=False):
res = _get_dir_source_name(PASTES_FOLDER, filter_dir=filter_dir) res = _get_dir_source_name(PASTES_FOLDER, filter_dir=filter_dir)
if r_list: if res:
res = list(res) if r_list:
return res res = list(res)
return res
else:
return []
def verify_sources_list(sources): def verify_sources_list(sources):
all_sources = get_all_items_sources() all_sources = get_all_items_sources()