Skip to content

Demo data for conference#4629

Open
marcoacierno wants to merge 1 commit intomainfrom
demo-data-command
Open

Demo data for conference#4629
marcoacierno wants to merge 1 commit intomainfrom
demo-data-command

Conversation

@marcoacierno
Copy link
Copy Markdown
Member

What

ToDo

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pycon Ready Ready Preview Apr 26, 2026 6:27pm

@marcoacierno marcoacierno marked this pull request as ready for review April 26, 2026 18:25
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

❌ Patch coverage is 0% with 107 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.61%. Comparing base (cdd2e2d) to head (fa2a036).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4629      +/-   ##
==========================================
- Coverage   92.52%   91.61%   -0.91%     
==========================================
  Files         359      360       +1     
  Lines       10791    10898     +107     
  Branches      821      831      +10     
==========================================
  Hits         9984     9984              
- Misses        696      803     +107     
  Partials      111      111              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 26, 2026

This PR adds a setup_first_conference management command to scaffold demo conference data for local development. Several issues found:

Invalid highlight_color value

"gray" is used as a highlight_color for the Silver sponsor level, but SponsorLevel.highlight_color is CharField(choices=COLORS) where COLORS = Choices("blue", "yellow", "orange", "cinderella", "violet", "green"). Django won't enforce this at the DB level so it saves silently, but full_clean() (admin save, form validation) will raise ValidationError. Use a valid color such as "cinderella".

Potential ProtectedError on --force re-run

The explicit Submission.objects.filter(conference=existing).delete() before existing.delete() is redundant (on_delete=CASCADE), but more critically: ScheduleItem.submission is on_delete=PROTECT, so if any ScheduleItem references these submissions the delete will raise ProtectedError. Similarly PrivacyPolicy.conference is on_delete=PROTECT — if a privacy policy record exists for the demo conference, existing.delete() also raises ProtectedError. There is no error handling and the --force flag gives the user no guidance on what to clean up first.

Sponsor.get_or_create on a non-unique field

Sponsor.name has no unique=True constraint. get_or_create(name=name) will raise MultipleObjectsReturned if duplicates exist. Since this is a controlled demo setup, use create() or scope the lookup to the conference.

conference.proposal_tags never populated

_create_conference calls .set() for topics, languages, audience levels, and submission types but never calls conference.proposal_tags.set(tags). The proposalTags GraphQL field returns an empty list for this conference, breaking the CFP tag selector in the frontend even though tags are created and assigned to submissions.

Duplicated admin user creation

The superuser creation logic (lines ~208–210) duplicates backend/users/management/commands/create_admin.py verbatim. Remove it and compose the two commands in a setup script or docker-compose entrypoint.

No tests

The --force re-run path, cascade deletes, and get_or_create calls have several failure modes (items above) with zero test coverage. A minimal smoke test running call_command("setup_first_conference") then call_command("setup_first_conference", "--force") would catch most of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant