seed icon indicating copy to clipboard operation
seed copied to clipboard

Auto-populate Sample Data fails, OrganizationViewSet doesn’t have an org attribute

Open devinbrady opened this issue 1 year ago • 1 comments

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

  1. Checkout the develop branch
  2. Build new containers
  3. Run migrations
  4. Create a user
  5. Click the "Auto-Populate Sample Data" button on the home page
  6. Error follows

Instance Information

Local instance on Mac running Apple Silicon.

devinbrady avatar Jun 24 '24 18:06 devinbrady

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"

devinbrady avatar Oct 08 '24 20:10 devinbrady