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

Add teams 2/3: Add functions to manage teams #547

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rth
Copy link
Collaborator

@rth rth commented Nov 6, 2021

This a follow up on #545 and adds ramp_database functions to create/join/leave and invite to teams.

Toward #505

Again it should be backward compatible, as long as those functions are not called (which will be done in a third PR).

TODO:

  • add tests for the few lines not included in test coverage.

@codecov
Copy link

codecov bot commented Nov 6, 2021

Codecov Report

Merging #547 (3c39c24) into master (977b27f) will decrease coverage by 0.01%.
The diff coverage is 93.20%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #547      +/-   ##
==========================================
- Coverage   93.51%   93.49%   -0.02%     
==========================================
  Files         103      103              
  Lines        8922     9076     +154     
==========================================
+ Hits         8343     8486     +143     
- Misses        579      590      +11     
Impacted Files Coverage Δ
ramp-database/ramp_database/tools/team.py 87.91% <82.53%> (-12.09%) ⬇️
ramp-database/ramp_database/model/event.py 98.88% <100.00%> (+0.03%) ⬆️
ramp-database/ramp_database/testing.py 100.00% <100.00%> (ø)
ramp-database/ramp_database/tools/_query.py 98.94% <100.00%> (+0.16%) ⬆️
ramp-database/ramp_database/tools/submission.py 97.17% <100.00%> (+0.01%) ⬆️
...p-database/ramp_database/tools/tests/test_query.py 100.00% <100.00%> (ø)
...mp-database/ramp_database/tools/tests/test_team.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 977b27f...3c39c24. Read the comment docs.

@BenjaminHabert
Copy link

BenjaminHabert commented Nov 30, 2021

Hello @rth. I had a quick look at these diffs as I said over email. Sorry if these inputs are not relevent : I am not very familiar with the code base.

I am under the impression that the current implementation is slighly different than what you described in #505 (comment)

The test_team::test_add_signup_leave_team() shows the following workflow:

  • user creates a team
  • team is signed-up to an event

However the initial plan was that a team is only created in the context of a given event. Did this change ?

If the initial plan is still what you are aiming for :

  • I think the method tools/team.py::add_team() should be renamed to add_team_in_event() and create at the same time the Team and TeamEvent objects. It should not be used to created is_individual teams (as these are created when a user is created). It could also check that the user making this request is allready registered in this event.
  • as a consequencesign_up_team() should not require the optional user_name param as this sign_up method would only be used
    for is_individual teams.

Another note : I think you might still end up with a user belonging to several multi-user teams in a single event:

  • there is a mechanism in tools/teams.py::respond_team_invite() to leave the previously joined team.
  • however I think a user can create multiple teams in a single event (and be the admin of each of those) if multiple calls to add_team() are made.
    • this can be usefull if a teacher wants to create all the teams
    • however it will be difficult for this user to make a submission: which team are they submitting for ? (select_event_team_by_user_name returns the first team only).

Let me know if I can help

@rth
Copy link
Collaborator Author

rth commented Dec 8, 2021

Thanks a lot for the review @BenjaminHabert, will try to respond to it soon.

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