Skip to content

Conversation

@taanvi2205
Copy link

@taanvi2205 taanvi2205 commented Nov 11, 2025

Remove unstable component selection and ensure initial event data setup (closes #1154)

Summary

This PR removes the unstable component selection UI (Tickets, Talk, Video) from the “Create Event” page and ensures all three components are initialized automatically when a new event is created.

Changes

  • Commented out “Create this event for” section in
    eventyay/eventyay_common/templates/eventyay_common/events/create_foundation.html
  • Ensured backend event initialization logic (talk/src/pretalx/event/models/event.py) builds all default components on event creation.

Expected Behavior

  • “Create this event for” section and related toggles are no longer visible.
  • Event creation automatically sets up Tickets, Talk, and Video.
  • No component-related warnings or errors occur.

Screenshots

Before:
Screenshot 2025-11-11 at 10 31 09 PM

After:
Screenshot 2025-11-11 at 9 53 24 PM
Screenshot 2025-11-11 at 9 54 10 PM

TODO (Future)

  • Reintroduce component selection once unified component setup is stable.
  • Re-enable event series after unified scheduling logic testing.

(closes #1154)

Summary by Sourcery

Remove the component-selection toggles from the event creation template and ensure all event components (Tickets, Talk, Video) are initialized by default during event setup.

Bug Fixes:

  • Automatically initialize the Tickets component on event creation to prevent missing component errors.

Enhancements:

  • Remove the unstable component-selection UI section from the Create Event page.
  • Update build_initial_data to auto-create default ticket items alongside Talk and Video components.

marvel at flowers and others added 13 commits October 10, 2025 07:32
Currently translated at 0.1% (3 of 4121 strings)

Translation: eventyay/Eventyay Tickets
Translate-URL: https://hosted.weblate.org/projects/open-event/eventyay-tickets/zh_Hant/
Currently translated at 0.2% (9 of 4121 strings)

Translation: eventyay/Eventyay Tickets
Translate-URL: https://hosted.weblate.org/projects/open-event/eventyay-tickets/zh_Hant/
Currently translated at 0.4% (18 of 4121 strings)

Translation: eventyay/Eventyay Tickets
Translate-URL: https://hosted.weblate.org/projects/open-event/eventyay-tickets/pl_INFORMAL/
Currently translated at 2.9% (123 of 4121 strings)

Translation: eventyay/eventyay
Translate-URL: https://hosted.weblate.org/projects/eventyay/eventyay/zh_Hant/
Currently translated at 2.9% (123 of 4121 strings)

Translation: eventyay/eventyay
Translate-URL: https://hosted.weblate.org/projects/eventyay/eventyay/zh_Hant/
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 11, 2025

Reviewer's Guide

Removes unstable component-selection UI from the “Create Event” page and enhances the build_initial_data method to automatically initialize the Tickets component alongside existing CfP, schedules, mail templates, review phases, and score categories.

Class diagram for updated Event initialization logic

classDiagram
    class Event {
        +build_initial_data()
        cfp
        schedules
        items
        score_categories
    }
    class CfP {
        event
        default_type
    }
    class Schedule {
        event
    }
    class ItemCategory {
        event
        name
    }
    class Item {
        event
        name
        default_price
        category
    }
    class ReviewScoreCategory {
        event
        name
    }
    class ReviewScore {
        category
        value
        label
    }
    Event --> CfP
    Event --> Schedule
    Event --> ItemCategory
    ItemCategory --> Item
    Event --> ReviewScoreCategory
    ReviewScoreCategory --> ReviewScore
Loading

File-Level Changes

Change Details Files
Removed unstable component-selection UI from the “Create Event” page
  • Commented out the “Create this event for” section and related toggles
  • Retained only essential form fields (organizer, event type, locales)
  • Inserted TODO comments for future reintroduction of selection logic
app/eventyay/eventyay_common/templates/eventyay_common/events/create_foundation.html
Enhanced backend event initialization to auto-setup Tickets component
  • Imported pretix.presale models for Item and ItemCategory
  • Added logic to create a default Tickets category and Item when none exist
  • Streamlined ReviewScore creation calls for score categories
talk/src/pretalx/event/models/event.py

Assessment against linked issues

Issue Objective Addressed Explanation
#1154 Remove the component selection options (Tickets, Talk, Video) from the 'Create Event' page UI and logic, and ensure all three components are created automatically when a new event is created.
#1154 Comment out or hide the 'Event series or time slot booking' option in the UI and skip all related form inputs and backend calls, with a TODO for future reactivation.
#1154 Ensure backend logic supports initializing all components (Tickets, Talk, Video) by default when an event is created.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The create_foundation.html template is cluttered with large commented-out sections; consider removing dead code or wrapping it behind a feature flag for better maintainability.
  • In build_initial_data, use get_or_create for ItemCategory and Item instead of always create to make initialization idempotent and avoid IntegrityErrors on reruns.
  • Ensure the automatic ticket setup covers any additional Pretix requirements (like quotas or tax rules) so no essential configurations are missing post-creation.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The create_foundation.html template is cluttered with large commented-out sections; consider removing dead code or wrapping it behind a feature flag for better maintainability.
- In build_initial_data, use get_or_create for ItemCategory and Item instead of always create to make initialization idempotent and avoid IntegrityErrors on reruns.
- Ensure the automatic ticket setup covers any additional Pretix requirements (like quotas or tax rules) so no essential configurations are missing post-creation.

## Individual Comments

### Comment 1
<location> `talk/src/pretalx/event/models/event.py:647-657` </location>
<code_context>

+        # --- New Section: Initialize Tickets system automatically ---
+        from pretix.presale.models import Item, ItemCategory  # adjust import if needed
+        if not self.items.exists():
+            category = ItemCategory.objects.create(event=self, name=_("Tickets"))
+            Item.objects.create(
</code_context>

<issue_to_address>
**suggestion (bug_risk):** Check for existing ticket categories/items with more granularity.

Currently, the check does not differentiate between ticket and non-ticket items, which may result in duplicate ticket categories. Please update the logic to specifically check for an existing 'Tickets' category or 'General Admission' item.

```suggestion
        # --- New Section: Initialize Tickets system automatically ---
        from pretix.presale.models import Item, ItemCategory  # adjust import if needed

        # Check for existing 'Tickets' category
        tickets_category = ItemCategory.objects.filter(event=self, name=_("Tickets")).first()
        if not tickets_category:
            tickets_category = ItemCategory.objects.create(event=self, name=_("Tickets"))

        # Check for existing 'General Admission' item in the 'Tickets' category
        general_admission_item = Item.objects.filter(
            event=self,
            name=_("General Admission"),
            category=tickets_category
        ).first()

        if not general_admission_item:
            Item.objects.create(
                event=self,
                name=_("General Admission"),
                default_price=0,
                category=tickets_category,
            )
        # ------------------------------------------------------------
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +647 to +657
# --- New Section: Initialize Tickets system automatically ---
from pretix.presale.models import Item, ItemCategory # adjust import if needed
if not self.items.exists():
category = ItemCategory.objects.create(event=self, name=_("Tickets"))
Item.objects.create(
event=self,
name=_("General Admission"),
default_price=0,
category=category,
)
# ------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (bug_risk): Check for existing ticket categories/items with more granularity.

Currently, the check does not differentiate between ticket and non-ticket items, which may result in duplicate ticket categories. Please update the logic to specifically check for an existing 'Tickets' category or 'General Admission' item.

Suggested change
# --- New Section: Initialize Tickets system automatically ---
from pretix.presale.models import Item, ItemCategory # adjust import if needed
if not self.items.exists():
category = ItemCategory.objects.create(event=self, name=_("Tickets"))
Item.objects.create(
event=self,
name=_("General Admission"),
default_price=0,
category=category,
)
# ------------------------------------------------------------
# --- New Section: Initialize Tickets system automatically ---
from pretix.presale.models import Item, ItemCategory # adjust import if needed
# Check for existing 'Tickets' category
tickets_category = ItemCategory.objects.filter(event=self, name=_("Tickets")).first()
if not tickets_category:
tickets_category = ItemCategory.objects.create(event=self, name=_("Tickets"))
# Check for existing 'General Admission' item in the 'Tickets' category
general_admission_item = Item.objects.filter(
event=self,
name=_("General Admission"),
category=tickets_category
).first()
if not general_admission_item:
Item.objects.create(
event=self,
name=_("General Admission"),
default_price=0,
category=tickets_category,
)
# ------------------------------------------------------------

@hongquan
Copy link
Member

Please use a descriptive title for the PR.
Reading "fix:closes #1154", people don't understand what this PR does.

ArnavBallinCode and others added 14 commits November 13, 2025 23:24
The issue was caused by unconditional access to test_form.cleaned_data
without checking if the form validation succeeded. When test_form.is_valid()
returned False, accessing cleaned_data could raise AttributeError or return
incomplete data, causing a 500 error.

Solution: Added conditional check to only access cleaned_data when form is
valid, otherwise use empty dict for initial values. This ensures the export
page loads properly even when no valid GET parameters are provided.

Changes:
- Modified ExportMixin.exporters property in control/views/orders.py
- Added validation check before accessing test_form.cleaned_data
- Fallback to empty dict when form is invalid
Applied the same fix from issueto the organizer-level export
functionality. The ExportMixin in organizer.py had the identical issue
where test_form.cleaned_data was accessed without checking if the form
validation succeeded first.

This prevents potential HTTP 500 errors when accessing:
- /control/organizer/{organizer}/export/

Changes:
- Modified ExportMixin.exporters in control/views/organizer.py
- Added validation check before accessing test_form.cleaned_data
- Fallback to empty dict when form is invalid
- Use f-strings instead of string concatenation for better readability
- Rename 'id' variable to 'identifier' to avoid shadowing builtin
- Apply improvements to both orders.py and organizer.py

Addresses Sourcery suggestions...
- Add JSON_FIELD_AVAILABLE setting based on database backend (postgresql = True)
- Fix checkinlists exporter using old Event.items instead of Event.products
- Resolves AttributeError when accessing export functionality
- Changed from if/else validation check to getattr() to preserve partial cleaned_data
- This allows useful defaults even when form is partially invalid
- Reverted unnecessary 'id' to 'identifier' rename in organizer.py
- Renamed 'items' field to 'products' in checkinlists exporter for consistency
- Updated form_data['items'] to form_data['products'] reference
Sak1012 and others added 28 commits December 1, 2025 22:41
…ponent layout (fossasia#1377)

* Move powered by eventyay below content area on Ticket Pages

* update email condition

* Apply Copilot suggestions

* remove contact us

---------

Co-authored-by: Mario Behling <[email protected]>
…1412)

* fix(language): Restore language selection to checkbox list

* fix(selection): Add fixes to selection
* added template files

* cfp

* fix: Add options management interface for CFP custom fields

* fix: Reorder form fields to match Pretalx

* fix: Display Field required radio buttons inline with proper Bootstrap styling

---------

Co-authored-by: Mario Behling <[email protected]>
)

Currently translated at 95.5% (5278 of 5522 strings)

Translation: eventyay/eventyay
Translate-URL: https://hosted.weblate.org/projects/eventyay/eventyay/de/

Co-authored-by: Andreas Kleinert <[email protected]>
…a#1340)

* Add auto-expanding textarea

* guard to prevent duplication

* inline JS to separate static file and other modifications

* initial text area & resize

* viewport-size

* initial height & scrollbar appears only inside textarea not on page

---------

Co-authored-by: Mario Behling <[email protected]>
* add logging

* add defaults via migration
* wip

* Add drag-and-drop reordering for talk question answer options

* Add i18n support and null check for drag-and-drop
* save room fix try and added logging

* implemented suggestions

---------

Co-authored-by: Mario Behling <[email protected]>
Currently translated at 30.1% (1660 of 5509 strings)

Translation: eventyay/eventyay
Translate-URL: https://hosted.weblate.org/projects/eventyay/eventyay/zh_Hant/
Currently translated at 27.2% (1501 of 5509 strings)

Translation: eventyay/eventyay
Translate-URL: https://hosted.weblate.org/projects/eventyay/eventyay/ko/
Currently translated at 17.7% (977 of 5509 strings)

Translation: eventyay/eventyay
Translate-URL: https://hosted.weblate.org/projects/eventyay/eventyay/ja/
Currently translated at 30.1% (1661 of 5509 strings)

Translation: eventyay/eventyay
Translate-URL: https://hosted.weblate.org/projects/eventyay/eventyay/zh_Hant/
Currently translated at 0.1% (5 of 5509 strings)

Translation: eventyay/eventyay
Translate-URL: https://hosted.weblate.org/projects/eventyay/eventyay/id/
Currently translated at 95.6% (5279 of 5519 strings)

Translation: eventyay/eventyay
Translate-URL: https://hosted.weblate.org/projects/eventyay/eventyay/de/
i18n(translations): update localized strings from Weblate
…ossasia#1435)

Updates the requirements on [sentry-sdk](https://github.com/getsentry/sentry-python) to permit the latest version.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-python@2.46.0...2.47.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-version: 2.47.0
  dependency-type: direct:production
...

Signed-off-by: Mario Behling <[email protected]>
Copy link
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Please address AI reviews. Thank you

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Cleanup: Simplify “Create Event” Page and Remove Unstable Options