Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Empty user e-mails. #29

Merged
merged 2 commits into from
Mar 12, 2018
Merged

Empty user e-mails. #29

merged 2 commits into from
Mar 12, 2018

Conversation

nihadness
Copy link
Contributor

Current behavior
If a user doesn't have any e-mail set in the source, then system fails to create that user in the destination.

Expected behavior after this PR
If a user doesn't have an e-mail set, set it to default value- [email protected].

@nihadness nihadness added the bug label Mar 2, 2018
@nihadness nihadness self-assigned this Mar 2, 2018
@nihadness nihadness requested a review from ramonski March 2, 2018 09:52
@@ -168,6 +168,8 @@ def _import_users(self):
logger.debug("Skipping existing user {}".format(username))
continue
email = user.get("email", "")
if not email:
email = "[email protected]"
Copy link
Member

Choose a reason for hiding this comment

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

Please, add at least a comment why you need to setup a "fake" email to the user. As per the accepted answer here https://stackoverflow.com/questions/1368163/is-there-a-standard-domain-for-testing-throwaway-email , seems that using example.com as domain is fine for testing purposes. I'd just only do the following change:

email = "{}@example.com".format(username)

@xispa xispa merged commit 806b6fd into senaite:master Mar 12, 2018
@nihadness nihadness deleted the user-emails branch May 4, 2018 09:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

2 participants