Replies: 1 comment
-
Hi @matinde, exactly how you do this would depend in part in how you're using the library. The absolute simplest thing to do though - though not the most thorough - would be to add the organization user count to the template context for the organization listing view, for example, and then disable or not show the link (or form) to add a new user. If you're using the library in the "default" way, by installing the Django app in your project and using the installed models, you might use a customized version of class CustomUserList(OrganizationUserList):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["user_count"] = self.organization.organization_users.count()
context["can_add_more_users"] = context["user_count"] < 6
return context This method is sufficient for simple scenarios. If you wanted this to be stricter you'd need to include a check on the user count in your organization user creation view and/or by extending the invitation backend and adding such a check in the |
Beta Was this translation helpful? Give feedback.
-
Hi, I have been wrangling with this library for a while, one thing I am wondering: For example if you want to limit the amount of users who can be added to an organization, what is the easiest way of doing that?
Beta Was this translation helpful? Give feedback.
All reactions