Skip to content
Snippets Groups Projects
Commit eb5cb30d authored by Carlos Vega's avatar Carlos Vega
Browse files

move creation of the admin user before reading the file so we can use it

parent 5cc0b4a0
No related branches found
Tags v0.12.1
1 merge request!184Fix/import file
......@@ -538,6 +538,17 @@ if __name__ == '__main__':
if not os.path.isfile(file):
logging.warn('Please, execute the program with a valid file path.')
sys.exit(1)
#create worker and super user
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'
lcsb_worker = createWorker(pass1)
df = pd.read_excel(file, dtype=object)
df = df.fillna('').astype(unicode)
df.columns = [c.upper() for c in df.columns]
......@@ -569,13 +580,4 @@ if __name__ == '__main__':
# process each row
for index, row in df.iterrows():
parse_row(index, row, visit_columns, appointmentTypes, voucher_types)
#create worker and super user
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
parse_row(index, row, visit_columns, appointmentTypes, voucher_types, lcsb_worker)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment