diff options
author | Filipp Lepalaan <filipp@mac.com> | 2016-11-04 15:08:53 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2016-11-04 15:08:53 +0200 |
commit | ba8b6375333e1f574970824ff243f84e6086a7c2 (patch) | |
tree | e2c7c7d109ec68a6a4c7d96d461d1d880b4650f1 | |
parent | c1eda10a3b2fe750882e6350309e2fda3bedb6ec (diff) | |
download | Servo-ba8b6375333e1f574970824ff243f84e6086a7c2.tar.gz Servo-ba8b6375333e1f574970824ff243f84e6086a7c2.tar.bz2 Servo-ba8b6375333e1f574970824ff243f84e6086a7c2.zip |
Confirm obfuscation
-rw-r--r-- | servo/management/commands/obfuscate.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/servo/management/commands/obfuscate.py b/servo/management/commands/obfuscate.py index 09e8639..4c8ada3 100644 --- a/servo/management/commands/obfuscate.py +++ b/servo/management/commands/obfuscate.py @@ -1,11 +1,10 @@ # -*- coding: utf-8 -*- from random import choice -from django.db.utils import IntegrityError from django.template.defaultfilters import slugify -from django.core.management.base import BaseCommand, CommandError +from django.core.management.base import BaseCommand -from servo.models import Customer, Order, User, Location, GsxAccount +from servo.models import Order, User, Location, GsxAccount class Command(BaseCommand): @@ -44,18 +43,19 @@ class Command(BaseCommand): 'Dorothy Perry', 'Lori Powell', 'Kathryn Murphy', 'Judy Johnson', 'Albert Morgan', 'William Richardson', 'Randy Stewart', 'Roger Thompson', 'Anna Rodriguez',) - """ + + confirm = raw_input('Are you sure you want to continue [Y/N]') + if confirm != 'Y': + return + print 'Munging customer names of open orders...' for i in Order.objects.filter(state=Order.STATE_QUEUED): if i.customer: i.customer.name = choice(names) i.customer.save() - """ + print 'Munging technician names' users = User.objects.exclude(username='filipp') - newnames = [x.split()[0].lower() for x in names] - oldnames = users.values_list("username", flat=True) - idx = 0 for i in users: i.first_name, i.last_name = choice(names).split() @@ -65,7 +65,6 @@ class Command(BaseCommand): print 'Munging location names' a = 65 for i in Location.objects.all(): - #i.title = 'Location %s' % chr(a) i.email = slugify(i.title) + '@example.com' i.city = 'Cupertino' i.phone = '0451 202 7' + str(a) |