Skip to content

Conversation

@jnovinger
Copy link
Member

Fixes: #19800

  • Fixes issue by adding profile to the list of fields the import form should recognize
  • Fixes up module type bulk import testing by adding necessary permissions for related models and adding inheritance of BulkImportObjectsViewTestCase
  • Adds an additional regression assertion to make sure that this fix does not regress

@jnovinger jnovinger requested review from a team and jeremystretch and removed request for a team July 2, 2025 12:51
InterfaceTemplate, FrontPortTemplate, RearPortTemplate, ModuleBayTemplate,
]
for model in additional_permissions:
obj_perm.object_types.add(ObjectType.objects.get_for_model(model))
Copy link
Member Author

Choose a reason for hiding this comment

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

Open to suggestions on this approach.

Copy link
Member

Choose a reason for hiding this comment

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

There's an add_permissions() method on the test case to facilitate this; will that work?

InterfaceTemplate, FrontPortTemplate, RearPortTemplate, ModuleBayTemplate,
]
for model in additional_permissions:
obj_perm.object_types.add(ObjectType.objects.get_for_model(model))
Copy link
Member

Choose a reason for hiding this comment

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

There's an add_permissions() method on the test case to facilitate this; will that work?

fields = [
'manufacturer', 'model', 'part_number', 'description', 'airflow', 'weight', 'weight_unit', 'comments',
'tags',
'tags', 'profile',
Copy link
Member

Choose a reason for hiding this comment

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

Could you move profile before comments in the list? It affects the ordering of the fields in the import form.

I ultimately left the extra asserts in for test_bulk_import_objects_with_permissionsince
since the parent test is currently only testing against number of
objects successfully imported. Will file a follow up FR to improve that
test.
@jnovinger jnovinger requested a review from jeremystretch July 14, 2025 14:50
@jeremystretch jeremystretch merged commit 44efa03 into main Jul 14, 2025
10 checks passed
@jeremystretch jeremystretch deleted the 19800-module-type-import-does-not-assign-profile branch July 14, 2025 19:22
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module type import does not assign profile

3 participants