Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect 'none' tag when upload metadata #401

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions ifcbdb/dashboard/accession.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,20 @@ def get_cell(named_tup, key):

if tag_cols:
for c in tag_cols:
tag = str(get_cell(row, c))
if tag is not None:
normalized = normalize_tag_name(tag)
if not tag or not normalized:
raise ValueError('blank tag name "{}"'.format(tag))
if re.match(r'^[0-9]+$',normalized):
raise ValueError('tag "{}" consists of digits'.format(tag))
b.add_tag(normalized)
cell = get_cell(row, c)
if cell is None:
continue

tag = str(get_cell(row, c)).strip()
if tag == '':
continue

normalized = normalize_tag_name(tag)
if not tag or not normalized:
raise ValueError('blank tag name "{}"'.format(tag))
if re.match(r'^[0-9]+$',normalized):
raise ValueError('tag "{}" consists of digits'.format(tag))
b.add_tag(normalized)

if comments_col is not None:
body = get_cell(row, comments_col)
Expand Down