Fix error (500) upon first connection of an account.

This commit is contained in:
Schimon Jehudah, Adv. 2024-09-05 16:27:53 +03:00
parent c31278b576
commit ea255d84e0

View file

@ -225,10 +225,9 @@ class Data:
entries_cache_node = Data.extract_iq_items_extra(iq, jabber_id) entries_cache_node = Data.extract_iq_items_extra(iq, jabber_id)
data_items = {node_type : entries_cache_node} data_items = {node_type : entries_cache_node}
Data.save_to_toml(filename_items, data_items) Data.save_to_toml(filename_items, data_items)
return ['fine', iq] # TODO Remove this line
else: else:
print('iq problem') return ['error', iq]
breakpoint()
print('iq problem')
else: else:
entries_cache = Data.open_file_toml(filename_items) entries_cache = Data.open_file_toml(filename_items)
if not node_type in entries_cache: return ['error', 'Directory "{}" is empty'. format(node_type)] if not node_type in entries_cache: return ['error', 'Directory "{}" is empty'. format(node_type)]
@ -264,10 +263,10 @@ class Data:
entries_iq = Data.extract_iq_items_extra(iq, jabber_id) entries_iq = Data.extract_iq_items_extra(iq, jabber_id)
entries_cache_node_new += entries_iq entries_cache_node_new += entries_iq
else: else:
print('iq problem') # TODO
breakpoint() # Handle this concern in a different fashion,
print('iq problem') # instead of stopping the whole operation.
return ['error', iq]
entries_cache_node += entries_cache_node_new entries_cache_node += entries_cache_node_new
if node_type == 'public': if node_type == 'public':