You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to assign a user to a group on the SignupCode admin view. So that when the user signs up, I check the group associated to a code and add the user to the corresponding group without the burden to do that manualy for a large number of users (more than 1000 users).
How could I do that?
The text was updated successfully, but these errors were encountered:
I found a clever way to do that. I created a code pattern like this: my_group_name-0001
Then, in the after_signup method I do this:
code = SignupCode.objects.get(email=self.created_user.email).code
group_name = code.split('-')[0]
group = Group.objects.get(name=group_name)
group.user_set.add(self.created_user)
This way I didn't need to customize the SignupCode model nor the Admin view.
Anyway, it would be a nice to do it the right way (changing the Admin view an add a relationship to groups) project so that we do not depend on a code pattern to enable this feature. Consider adding this to the project.
I would like to assign a user to a group on the SignupCode admin view. So that when the user signs up, I check the group associated to a code and add the user to the corresponding group without the burden to do that manualy for a large number of users (more than 1000 users).
How could I do that?
The text was updated successfully, but these errors were encountered: