Skip to content

Commit

Permalink
Merge pull request #4769 from NyanKiyoshi/fix/populatedb/skip-existin…
Browse files Browse the repository at this point in the history
…g-emails

Fixed random failure of creating users in populatedb
  • Loading branch information
maarcingebala committed Sep 27, 2019
2 parents c7e275d + 9ff0f90 commit 0397b33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Fixed the inability of users to set a variant's `priceOverride` and `costPrice` to `null` - #4754 by @NyanKiyoshi
- PaymentGatewayEnum removed from GraphQL schema as gateways now are dynamic plugins. Gateway names changed. - #4756 by @salwator
- Add support for webhooks - #4731 by @korycins
- Fixed the random failure of `populatedb` trying to create a new user with an existing email - #4769 by @NyanKiyoshi

## 2.8.0

Expand Down
4 changes: 4 additions & 0 deletions saleor/core/utils/random_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ def create_fake_user():
address = create_address()
email = get_email(address.first_name, address.last_name)

# Skip the email if it already exists
if User.objects.filter(email=email).exists():
return

user = User.objects.create_user(
first_name=address.first_name,
last_name=address.last_name,
Expand Down

0 comments on commit 0397b33

Please sign in to comment.