Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Commits
32dd9347
Commit
32dd9347
authored
6 years ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
ask the user for a password
parent
ee90228d
No related branches found
No related tags found
1 merge request
!181
Hotfix/import file
Pipeline
#7291
passed
6 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/import_file.py
+10
-3
10 additions, 3 deletions
smash/import_file.py
with
10 additions
and
3 deletions
smash/import_file.py
+
10
−
3
View file @
32dd9347
# 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment