Skip to content

Fix issue #7: add clubs points display board - #6

Merged
Aurelien7777 merged 1 commit into
masterfrom
feature/7-display-club-points-board
May 5, 2026
Merged

Aurelien7777 merged 1 commit into
masterfrom
feature/7-display-club-points-board

Conversation

@Aurelien7777

@Aurelien7777 Aurelien7777 commented May 5, 2026 •

Copy link
Copy Markdown
Owner

Description

This pull request implements the clubs points display board.

When a secretary logs into the application, they can now see the list of all clubs and their current points balance on the summary page.

Changes made

  • Updated the /showSummary route to pass the full clubs list to welcome.html.
  • Updated welcome.html to display each club with its current points balance.
  • Added a test to verify that the clubs list and their points are displayed after a successful login.

Closes #7

Summary by Sourcery

Display clubs and their current points on the summary page after login.

New Features:

  • Show a list of all clubs and their current points balance on the welcome summary page after login.

Tests:

  • Add an integration test to verify that the clubs list and their points appear on the summary page after a successful login.

@sourcery-ai

sourcery-ai Bot commented May 5, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implements a clubs points display board by passing the full clubs list to the summary template, rendering each club and its points on the welcome page, and adding a test to verify that the list and balances appear after login, along with some minor formatting adjustments in tests and template.

Sequence diagram for displaying clubs points after secretary login

sequenceDiagram
    actor Secretary
    participant Browser
    participant FlaskServer
    participant TemplateEngine

    Secretary->>Browser: Submit login form (email)
    Browser->>FlaskServer: POST /showSummary with email
    FlaskServer->>FlaskServer: Lookup club by email
    FlaskServer->>FlaskServer: Load competitions list
    FlaskServer->>FlaskServer: Load clubs list
    FlaskServer->>TemplateEngine: Render welcome_html with club, competitions, clubs
    TemplateEngine-->>FlaskServer: HTML with competitions and clubs points board
    FlaskServer-->>Browser: 200 OK (welcome page)
    Browser-->>Secretary: Display competitions and clubs points board
Loading

File-Level Changes

Change Details Files
Pass the full clubs list into the summary view so templates can render per-club points.
  • Updated the showSummary route to include the clubs collection in the template context
  • Ensured existing club and competitions data passed to the template remain unchanged
server.py
Render a clubs points board on the welcome page using the provided clubs data.
  • Added a new Clubs section listing each club name and its current points
  • Iterated over the clubs context variable to build the list items
  • Adjusted existing markup structure and horizontal rule placement to accommodate the new section
templates/welcome.html
Verify that the clubs list and their points are visible on the summary page after login.
  • Added a new test that logs in via /showSummary and asserts the club name appears in the response
  • Asserted the current points for the logged-in club are rendered in the response body
  • Performed minor whitespace/formatting tweaks around existing tests without changing their behavior
test/test_server.py

Assessment against linked issues

Issue Objective Addressed Explanation
OpenClassrooms-Student-Center#7 Update the application so that after a secretary logs in and is shown the summary page, the page displays a list of all clubs with each club’s current points balance. ✅
OpenClassrooms-Student-Center#7 Ensure the backend passes the necessary club data to the summary template and add automated test coverage verifying that clubs and their points are displayed after login. ✅

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

@sourcery-ai sourcery-ai Bot 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.

Hey - I've left some high level feedback:

  • In test_display_list_of_club_and_their_current_point, the booking_test_data fixture’s competition_test value is never used and the test hardcodes admin@irontemple.com instead of using club_test['email'], which makes the test more brittle than necessary; consider deriving the email from club_test and dropping the unused fixture component.
  • The new test name test_display_list_of_club_and_their_current_point is slightly awkward and inconsistent with the other tests’ naming style; consider renaming it to something like test_show_summary_displays_club_points to better reflect behavior and align with existing test naming conventions.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `test_display_list_of_club_and_their_current_point`, the `booking_test_data` fixture’s `competition_test` value is never used and the test hardcodes `admin@irontemple.com` instead of using `club_test['email']`, which makes the test more brittle than necessary; consider deriving the email from `club_test` and dropping the unused fixture component.
- The new test name `test_display_list_of_club_and_their_current_point` is slightly awkward and inconsistent with the other tests’ naming style; consider renaming it to something like `test_show_summary_displays_club_points` to better reflect behavior and align with existing test naming conventions.

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.

@Aurelien7777
Aurelien7777 merged commit 0cdfd74 into master May 5, 2026
1 check passed
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.

FEATURE: Implement Points Display Board

1 participant