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
eb5cb30d
Commit
eb5cb30d
authored
6 years ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
move creation of the admin user before reading the file so we can use it
parent
5cc0b4a0
No related branches found
Branches containing commit
Tags
v0.12.1
Tags containing commit
1 merge request
!184
Fix/import file
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/import_file.py
+12
-10
12 additions, 10 deletions
smash/import_file.py
with
12 additions
and
10 deletions
smash/import_file.py
+
12
−
10
View file @
eb5cb30d
...
...
@@ -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
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