Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Team add member #201

Merged
merged 3 commits into from
Jan 23, 2025
Merged

Conversation

FranzForstmayr
Copy link
Contributor

Description

This PR adds an unit test to the teams/<id>/members/add and .../remove endpoints, which are not working currently.

The endpoints were missing the users_service dependency, which was added.
In TeamService just the tag_name is passed to slugify, as this function accepts only strings.

@FranzForstmayr FranzForstmayr requested review from cofin and a team as code owners January 23, 2025 09:46
@FranzForstmayr FranzForstmayr changed the title Team add member fix: Team add member Jan 23, 2025
@FranzForstmayr
Copy link
Contributor Author

I get one more warning while running the unit tests now, but I'm not sure how to fix this:

tests/integration/test_teams.py::test_teams_add_remove_member
  sys:1: SAWarning: Object of type <Team> not in session, add operation along 'Tag.teams' won't proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation. Consider using ``no_autoflush`` context manager if this warning happended while initializing objects.)

@cofin
Copy link
Member

cofin commented Jan 23, 2025

I get one more warning while running the unit tests now, but I'm not sure how to fix this:

tests/integration/test_teams.py::test_teams_add_remove_member
  sys:1: SAWarning: Object of type <Team> not in session, add operation along 'Tag.teams' won't proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation. Consider using ``no_autoflush`` context manager if this warning happended while initializing objects.)

We need to specify this as having an eager load. I'll take a look today. Thanks for the PR

@cofin cofin merged commit 07340da into litestar-org:main Jan 23, 2025
10 of 11 checks 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.

2 participants