Commit 6f8449ee authored by Michal Čihař's avatar Michal Čihař

Check for email duplicates as well on import

parent 4eafb426
...@@ -38,7 +38,10 @@ class Command(BaseCommand): ...@@ -38,7 +38,10 @@ class Command(BaseCommand):
for line in data: for line in data:
if User.objects.filter(username=line['username']).exists(): if User.objects.filter(username=line['username']).exists():
print('Skipping {}'.format(line['username'])) print('Skipping {}, username exists'.format(line['username']))
continue
if User.objects.filter(email=line['email']).exists():
print('Skipping {}, email exists'.format(line['email']))
continue continue
User.objects.create( User.objects.create(
username=line['username'], username=line['username'],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment