Skip to content

fix(api): update api's for sponosrs#55

Merged
Sak1012 merged 1 commit into
FOSSASIA-Web:mainfrom
Sak1012:main
May 6, 2026
Merged

fix(api): update api's for sponosrs#55
Sak1012 merged 1 commit into
FOSSASIA-Web:mainfrom
Sak1012:main

Conversation

@Sak1012

@Sak1012 Sak1012 commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Bug Fixes:

  • Mark created sponsor groups to be shown on the front page so they are no longer omitted from front-page displays.

Copilot AI review requested due to automatic review settings May 6, 2026 10:09
@sourcery-ai

sourcery-ai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Ensures newly resolved sponsor groups are configured to be visible on the front page by default when created via the API.

Sequence diagram for sponsor group resolution with front page visibility

sequenceDiagram
    actor Organizer
    participant Frontend
    participant ExhibitionAPI
    participant SponsorGroupService

    Organizer->>Frontend: Create sponsor with sponsor_group_name
    Frontend->>ExhibitionAPI: POST /sponsors
    ExhibitionAPI->>ExhibitionAPI: _resolve_sponsor_group(sponsor_group_name, sponsor_group_level)
    ExhibitionAPI->>SponsorGroupService: get_or_create(event, name, level, show_on_front_page=True)
    SponsorGroupService-->>ExhibitionAPI: SponsorGroup
    ExhibitionAPI-->>Frontend: Response including sponsor_group.show_on_front_page = true
    Frontend-->>Organizer: Sponsor shown as visible on front page
Loading

File-Level Changes

Change Details Files
Set newly created sponsor groups to be shown on the front page by default during sponsor group resolution.
  • Extend sponsor group creation parameters to include show_on_front_page flag
  • Hard-code show_on_front_page to True when creating a sponsor group in _resolve_sponsor_group
exhibition/api.py

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

@Sak1012 Sak1012 merged commit 5b09b51 into FOSSASIA-Web:main May 6, 2026
5 checks passed

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Hardcoding show_on_front_page=True in _resolve_sponsor_group removes flexibility for callers that might want non-front-page sponsor groups; consider passing this as a parameter or deriving it from the context instead.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Hardcoding `show_on_front_page=True` in `_resolve_sponsor_group` removes flexibility for callers that might want non-front-page sponsor groups; consider passing this as a parameter or deriving it from the context instead.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request updates the exhibition API behavior when auto-creating a SponsorGroup from ExhibitorInfoSerializer by explicitly marking newly created sponsor groups as visible on the event front page.

Changes:

  • Set show_on_front_page=True when creating a new SponsorGroup inside _resolve_sponsor_group.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread exhibition/api.py
event=event,
name={event.locale or settings.LANGUAGE_CODE: sponsor_group_name},
level=sponsor_group_level,
show_on_front_page=True,
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.

2 participants