Skip to content

Commit

Permalink
fix: [tags] fix invalid tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Feb 2, 2024
1 parent b1ec6bd commit a7fd838
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/lib/Tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ def api_add_obj_tags(tags=[], galaxy_tags=[], object_id=None, object_type="item"
# r_serv_metadata.srem('tag:{}'.format(object_id), tag)
# r_tags.srem('{}:{}'.format(object_type, tag), object_id)

def delete_tag(object_type, tag, object_id, obj_date=None): ################################ # TODO:
def delete_tag(object_type, tag, object_id, obj_date=None): ################################ # TODO: REMOVE ME
# tag exist
if is_obj_tagged(object_id, tag):
if not obj_date:
Expand Down Expand Up @@ -1613,6 +1613,11 @@ def _fix_tag_obj_id(date_from):
print(tag)
new_tag = tag.split(';')[0]
print(new_tag)
r_tags.hdel(f'tag_metadata:{tag}', 'first_seen')
r_tags.hdel(f'tag_metadata:{tag}', 'last_seen')
r_tags.srem(f'list_tags:{obj_type}', tag)
r_tags.srem(f'list_tags:{obj_type}:', tag)
r_tags.srem(f'list_tags', tag)
raw = get_obj_by_tags(obj_type, [tag], nb_obj=500000, date_from=date_from, date_to=date_to)
if raw.get('tagged_obj', []):
for obj_id in raw['tagged_obj']:
Expand Down

0 comments on commit a7fd838

Please sign in to comment.