diff --git a/smash/import_file.py b/smash/import_file.py index c7c08e69705fdd5ff4eb5716c5926567066f2760..00de3e19e853cff7b88c624f4e4518074651ac24 100644 --- a/smash/import_file.py +++ b/smash/import_file.py @@ -1,5 +1,6 @@ # coding=utf-8 import os +import getpass import django from django.conf import settings os.environ.setdefault("DJANGO_SETTINGS_MODULE", "smash.settings") @@ -497,8 +498,7 @@ def parse_row(index, row, visit_columns, appointmentTypes, voucher_types): minutes=appointment_type.default_duration) app_type_link.save() -def createWorker(username='admin', email='carlos.vega@uni.lu', - password='pdptestpassword1234', first_name='LCSB', last_name='Admin', +def createWorker(password, email='', username='admin', first_name='LCSB', last_name='Admin', specialization='Technician', unit='LCSB'): # create user @@ -571,4 +571,11 @@ if __name__ == '__main__': for index, row in df.iterrows(): parse_row(index, row, visit_columns, appointmentTypes, voucher_types) #create worker and super user - createWorker() \ No newline at end of file + pass1 = '' + pass2 = None + while pass1 != pass2: + pass1 = getpass.getpass('Please type a password for the Admin user: ') + pass2 = getpass.getpass('Please type your password again: ') + if pass1 != pass2: + print 'Password mismatch, please try again' + createWorker(pass1) \ No newline at end of file