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

ask the user for a password

parent ee90228d
No related branches found
No related tags found
1 merge request!181Hotfix/import file
Pipeline #7291 passed
# 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
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