Skip to content

Conversation

Joe-Heffer-Shef
Copy link
Collaborator

@Joe-Heffer-Shef Joe-Heffer-Shef commented Apr 23, 2025

Issue #21

Changes:

  • Implemented user invitation flow based on the Django Invitations app/plugin but modified for our use-case.
  • Remove user: added user interface, view.
  • Added a permissions check to OrganisationService.remove_user_from_organisation

/myorganisation/members/invite
image

/signup/nmtgy0txpg02idzupxjwx9mw46iehmyycvvnbkfkt09fizfjg74mjwcggau0nf9k
image

Remove user

image
image
image

@Joe-Heffer-Shef Joe-Heffer-Shef self-assigned this Apr 23, 2025
@Joe-Heffer-Shef Joe-Heffer-Shef linked an issue Apr 28, 2025 that may be closed by this pull request
3 tasks
@Joe-Heffer-Shef Joe-Heffer-Shef marked this pull request as ready for review April 28, 2025 17:24
@Joe-Heffer-Shef Joe-Heffer-Shef changed the title Invite new organisation members Organisation member management Apr 29, 2025
@param organisation: The organisation to remove the user from
@param removed_user: The user to revoke permissions from
"""
if not self.can_edit(user, organisation):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This permission check wasn't here before.

@twinkarma
Copy link
Contributor

Can we add an "Invite pending" list on the page with the ability to cancel the invite?

@Joe-Heffer-Shef
Copy link
Collaborator Author

Joe-Heffer-Shef commented May 1, 2025

Can we add an "Invite pending" list on the page with the ability to cancel the invite?

Yeah that's doable. Sub issue #256

@twinkarma
Copy link
Contributor

Is it meant to be sending emails with the invitation? I've been testing locally with maildev, it doesn't seem to be catching any sent emails and no errors were raised either.

Otherwise the rest of the functionalities seem to be working fine.

@Joe-Heffer-Shef
Copy link
Collaborator Author

Joe-Heffer-Shef commented May 1, 2025

Yes it sends emails - do you have the console email plugin enabled?

# .env
DJANGO_EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend

I'm not sure how email stuff is configured in this branch

@twinkarma
Copy link
Contributor

Once you've been invited and accepted you can't be invited again (e.g. if the invitee deleted their user account but want to be invited again to the project). I'm guessing you'll need to run the command to clear the invitations list first?

@Joe-Heffer-Shef
Copy link
Collaborator Author

Once you've been invited and accepted you can't be invited again (e.g. if the invitee deleted their user account but want to be invited again to the project). I'm guessing you'll need to run the command to clear the invitations list first?

Ah right, yeah it makes an Invitation record.

The records are tied to a user registration, rather than being added/removed to an org.

Also, if someone was invited, joined, and then removed, you wouldn't be able to add them to the org again at all.

@Joe-Heffer-Shef
Copy link
Collaborator Author

We could make it so that someone can be added to an org straight away if that User already exists.

Copy link
Contributor

@twinkarma twinkarma left a comment

Choose a reason for hiding this comment

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

LGTM, good work!

About not getting email in maildev I'm assuming it's configuration issue on my end so you can ignore that.

Other issues I've mentioned are lower priority and can be addressed in a separate PR.

@Joe-Heffer-Shef Joe-Heffer-Shef merged commit a0729a9 into dev May 1, 2025
4 checks passed
@Joe-Heffer-Shef Joe-Heffer-Shef deleted the feat/21-manage-org-members branch May 1, 2025 13:14
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.

Organisation members management
2 participants