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

[change] User Model Extension (Bulk Update) #310

Open
chanduaki opened this issue Sep 30, 2021 · 5 comments
Open

[change] User Model Extension (Bulk Update) #310

chanduaki opened this issue Sep 30, 2021 · 5 comments
Labels
enhancement New feature or request Hacktoberfest Easy issues for attracting Hacktoberfest participants.

Comments

@chanduaki
Copy link

Extending User Models in openwisp-radius
I have followed the documentation(https://github.com/openwisp/openwisp-users/#extend-openwisp-users) to extended the User models. But when we extend the User models here

Are these fields will add in Bulk User creation ( through csv we are doing according to https://openwisp-radius.readthedocs.io/en/latest/user/importing_users.html)

But when i have in the code itself , only considering the below fields to create or update the user according to

def get_or_create_user(self, row, users_list, password_length):

    User = get_user_model()
    username, password, email, first_name, last_name = row

This was seen in multiple places , fixing the fields in the Bulk User creation

Do we need to make changes in the core code or is there any other way to extend them

I think code needs to be improved

@nemesifier nemesifier added enhancement New feature or request Hacktoberfest Easy issues for attracting Hacktoberfest participants. labels Sep 30, 2021
@nemesifier
Copy link
Member

nemesifier commented Sep 30, 2021

I think we should add an additional method there which by default is empty but can be used by third party apps to add their own logic.

Eg:

    ...
    user = self.customize_user_creation(user, row)
    user.full_clean()

def customize_user_creation(user, row):
     return user

Third parties should be able to extend customize_user_creation to do add the custom fields.

We should create a test for this use case in the SAMPLE_APP: https://github.com/openwisp/openwisp-radius/tree/master/tests/openwisp2/sample_radius

@nemesifier nemesifier changed the title User Model Extension ( Bulk Updation) [change] User Model Extension (Bulk Update) Sep 30, 2021
@eleensmathew
Copy link

Hi can i work on this? Since i am new can you please explain the issue and its solution in simple terms?

@codesankalp
Copy link
Member

You can start working @eleensmathew

@codesankalp
Copy link
Member

codesankalp commented Feb 6, 2022

Since i am new can you please explain the issue and its solution in simple terms?

If you are new, please try to explore openwisp-radius first.

@eleensmathew
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest Easy issues for attracting Hacktoberfest participants.
Projects
Status: To do (Python & Django)
Development

No branches or pull requests

4 participants