Skip to content
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
11 changes: 3 additions & 8 deletions specifyweb/backend/workbench/upload/upload_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,11 @@ def static_adjustments(
table: str, wbcols: dict[str, ExtendedColumnOptions], static: dict[str, Any]
) -> dict[str, Any]:
if (
table.lower() == "agent"
and "agenttype" not in wbcols
and "agenttype" not in static
):
static = {"agenttype": 1, **static}
elif (
table.lower() == "determination"
and "iscurrent" not in wbcols
and "iscurrent" not in static
):
static = {"iscurrent": True, **static}
else:
static = static
return static


Expand Down Expand Up @@ -755,6 +747,9 @@ def _do_upload(
),
}

if self.current_id is None and self.name.lower() == "agent":
new_attrs.setdefault("agenttype", 1)

with transaction.atomic():
try:
if self.current_id is None:
Expand Down