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

User Import - small import improvement (Mail / gender recognition) #3823

Closed
MSoeb opened this issue Jul 8, 2024 · 2 comments · Fixed by #4073
Closed

User Import - small import improvement (Mail / gender recognition) #3823

MSoeb opened this issue Jul 8, 2024 · 2 comments · Fixed by #4073
Assignees
Labels
enhancement General enhancement which is neither bug nor feature good first issue Schrödinger projectname
Milestone

Comments

@MSoeb
Copy link

MSoeb commented Jul 8, 2024

Description: When importing accounts or participants, there is always the problem that some attributes (e-mail and gender) can have spaces BEFORE and AFTER the value. This leads to problems during import. The conflict must be resolved manually.

Example of the csv file with additional spaces. First mail column has spaces before and after the mail. Second mail has no spaces:
image

What should happen:
It would be good if spaces BEFORE and AFTER certain attributes were automatically ignored when uploading the csv file, as these are not logically possible.

Affected attributes:

  • E-mail
  • Gender

Info: Issue is part of META issue #3809

@MSoeb MSoeb added enhancement General enhancement which is neither bug nor feature Schrödinger projectname labels Jul 8, 2024
@MSoeb MSoeb added this to the 4.2 milestone Jul 8, 2024
@MSoeb MSoeb changed the title User Import - small import improvement (Mail recognition) User Import - small import improvement (Mail / gender recognition) Jul 8, 2024
@vkrasnovyd vkrasnovyd self-assigned this Aug 21, 2024
@vkrasnovyd
Copy link
Contributor

@MSoeb Hi Marcus! I've done some research before writing a solution and found 2 options how to resolve this issue. I need your help to choose which approach would be more suitable.

First, some context. While recreating the problem I found out, that actually all attributes may be affected by it: removing spaces at the beginning and end of a string during parsing is not currently configured.
But only some of such fields with extra whitespaces trigger errors: email, gender (mentioned in this issue) and username.

There are 2 ways to deal with this:

  1. Remove extra spaces only for the attributes that cause errors (email, gender, username) - as described in this issue.
  2. Remove spaces at the beginning and end of each line for all attributes.
    In both cases, the spaces in the middle of the lines will not be changed or removed.

Option 1 (only fields that cause errors) is a better choice if whitespaces in the begginning or end of some other fields (for example name) are important. But I can't think of a case where this would be relevant for this project.

Option 2 (cleanup all data) is as easy to implement as option 1, but it will produce cleaner parsed data.

Please let me know which option you think is more appropriate.

@MSoeb
Copy link
Author

MSoeb commented Aug 30, 2024

Option 2 sounds good. You could solve it this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancement which is neither bug nor feature good first issue Schrödinger projectname
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants