Auto-populate Sample Data fails, OrganizationViewSet doesn’t have an org attribute
Describe the bug
On a fresh installation of SEED, when I click the "Auto-Populate Sample Data" button on the home page, I get an error saying that the OrganizationViewSet doesn’t have an org attribute.
End of the stack trace:
File "/seed/seed/views/v3/organizations.py", line 1236, in insert_sample_data
import_record = ImportRecord.objects.create(name="Auto-Populate", super_organization=org, access_level_instance=self.org.root)
AttributeError: 'OrganizationViewSet' object has no attribute 'org'
"GET /api/v3/organizations/1/insert_sample_data/ HTTP/1.1" 500 16910
The line in question: https://github.com/SEED-platform/seed/blob/develop/seed/views/v3/organizations.py#L1236
Expected Behavior
Sample data should be fully populated into the database and the GET call to insert_sample_data should return 200.
Actual Behavior
The sample data is partially inserted into the database and the GET call returns 500.
Steps to Reproduce
- Checkout the
developbranch - Build new containers
- Run migrations
- Create a user
- Click the "Auto-Populate Sample Data" button on the home page
- Error follows
Instance Information
Local instance on Mac running Apple Silicon.
I replicated this bug on dev1. I made a new organization as a superuser, clicked the the "Auto-Populate Sample Data" button, then Continue. It failed with "internal server error"