Skip to content
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ export function InteractionDialog({
);

const isLoanReturnLike =
isLoanReturn || (actionTable.name !== 'Loan' && actionTable.name.includes('Loan'));
isLoanReturn ||
Copy link
Copy Markdown
Member

@grantfitzsimmons grantfitzsimmons Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this PR reformat this?

(actionTable.name !== 'Loan' && actionTable.name.includes('Loan'));

const itemTable = isLoanReturnLike ? tables.Loan : tables.CollectionObject;

Expand Down Expand Up @@ -206,8 +207,7 @@ export function InteractionDialog({
)
).then((data) =>
availablePrepsReady(catalogNumbers, data, {
skipEntryMatch:
searchField.name.toLowerCase() !== 'catalognumber',
skipEntryMatch: searchField.name.toLowerCase() !== 'catalognumber',
})
)
);
Expand Down Expand Up @@ -377,7 +377,9 @@ export function InteractionDialog({
values,
isLoan
)
).then((data) => availablePrepsReady(values, data, { skipEntryMatch: true }))
).then((data) =>
availablePrepsReady(values, data, { skipEntryMatch: true })
)
);
}

Expand Down
23 changes: 17 additions & 6 deletions specifyweb/specify/migration_utils/update_schema_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def update_table_schema_config_with_defaults(
apps = global_apps
):
Splocalecontainer = apps.get_model('specify', 'Splocalecontainer')
Splocalecontaineritem = apps.get_model('specify', 'Splocalecontaineritem')
Splocaleitemstr = apps.get_model('specify', 'Splocaleitemstr')

table = datamodel.get_table(table_name)
Expand All @@ -108,8 +109,10 @@ def update_table_schema_config_with_defaults(
name=table.name,
discipline_id=discipline_id,
schema_type=0,
description=camel_to_spaced_title_case(uncapitilize(table.name)) if description is None else description,
language="en"
description=camel_to_spaced_title_case(uncapitilize(table.name))
if description is None
else description,
language="en",
)

# Create Splocalecontainer for the table
Expand All @@ -121,8 +124,12 @@ def update_table_schema_config_with_defaults(
issystem=table.system,
version=0,
)
if not is_new:
return # If the container already exists, we don't need to update it

if Splocalecontaineritem.objects.filter(
container=sp_local_container,
name=table_config.name.lower(),
).exists():
return

# Create a Splocaleitemstr for the table name and description
for k, text in {
Expand All @@ -138,8 +145,12 @@ def update_table_schema_config_with_defaults(
Splocaleitemstr.objects.get_or_create(**item_str)

for field in table.all_fields:
update_table_field_schema_config_with_defaults(table_name, discipline_id, field.name, apps)

update_table_field_schema_config_with_defaults(
table_name,
discipline_id,
field.name,
apps,
)

def revert_table_schema_config(table_name, apps=global_apps):
Splocalecontainer = apps.get_model('specify', 'Splocalecontainer')
Expand Down