Skip to content

Add a team creation form to My Teams - #906

Open
TinyMarsh wants to merge 5 commits into
mainfrom
new-team-form
Open

TinyMarsh wants to merge 5 commits into
mainfrom
new-team-form

Conversation

@TinyMarsh

Copy link
Copy Markdown
Contributor

Summary

My Teams → Create team → enter a name and description
  Cancel → My Teams
  Name or URL unavailable → show an error and keep the description
  Submit valid details → open the new team with the creator as its only manager

Closes #705. Inviting members and promoting them to manager remain separate.

Evidence

  • Before: The new tests failed because there was no create route or link, and unusable URLs did not return a name-field error.
  • After: pytest: 317 passed, 37 expected accessibility failures. mypy ., pre-commit, and mkdocs build --strict passed. The new controls fit at 390px and 1280px in Chromium.

Merge Danger

Door: Two-way. No model or migration changes. Reverting the form leaves teams already created in place.

Blast Radius: Teams.

TinyMarsh and others added 5 commits December 1, 2026 15:20
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refs #705

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refs #705

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Dec 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
main/forms.py 83.87% 5 Missing ⚠️
main/views/team_views.py 90.90% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@AdrianDAlessandro AdrianDAlessandro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know you haven't requested a review yet, but this is already looking pretty good.

Inviting members and promoting them to manager remain separate.

Have you opened separate issues to tackle this? The inviting members option should be really easy (just include a button that links to the "team-invitation-link" url), so it might be easy to just add that to this PR.

Promoting to manager requires a little more thought.

Additionally, managers should be able to delete their teams. And members should be able to leave their teams. Possibly a red button (btn-danger) at the bottom?

<h1>My Teams</h1>
<div class="d-flex flex-wrap align-items-center justify-content-between gap-2 mb-3">
<h1 class="mb-0">My Teams</h1>
<a class="btn btn-dark" href="{% url 'team-create' %}">Create team</a>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<a class="btn btn-dark" href="{% url 'team-create' %}">Create team</a>
<a class="btn btn-primary" href="{% url 'team-create' %}">Create team</a>

<form method="post">
{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-dark">Create team</button>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<button type="submit" class="btn btn-dark">Create team</button>
<button type="submit" class="btn btn-primary">Create team</button>

@TinyMarsh

Copy link
Copy Markdown
Contributor Author

Thanks @AdrianDAlessandro. I've added an "Invite members" button to the team page, shown only to managers, linking to the invitation link page.

Promoting/demoting managers, leaving a team and deleting a team each need a bit of design (e.g. protecting the last manager, confirmation before deleting), so I've opened #912, #913 and #914 for those rather than grow this PR. The service functions for leaving, removing members and changing roles already exist in team_services.py, so those should mostly be UI work.

This branch has not been deployed

No deployments
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.

Add create new teams form

2 participants