Add cmsRemoveTeam#1694
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new CMS contributor CLI command, cmsRemoveTeam, enabling removal of a Team record from the CMS database via a console script entry point.
Changes:
- Register a new
cmsRemoveTeamconsole script insetup.py. - Add
cmscontrib/RemoveTeam.pyimplementing team lookup by code and deletion.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| setup.py | Registers the new cmsRemoveTeam console entry point. |
| cmscontrib/RemoveTeam.py | Implements the CLI workflow and DB deletion logic for removing a team. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def remove_team(code: str) -> bool: | ||
| with SessionGen() as session: | ||
| team = session.query(Team).filter(Team.code == code).first() | ||
| if team is None: | ||
| logger.error("Team %s does not exist.", code) | ||
| return False | ||
|
|
||
| session.delete(team) | ||
| session.commit() |
|
|
||
| """ | ||
| parser = argparse.ArgumentParser( | ||
| description="Remove a team from CMS .") |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1694 +/- ##
==========================================
- Coverage 53.89% 53.88% -0.01%
==========================================
Files 341 342 +1
Lines 27977 28000 +23
==========================================
+ Hits 15077 15087 +10
- Misses 12900 12913 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.