Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hpc-team
sshshare_ws
Commits
3bcb2865
Commit
3bcb2865
authored
Feb 08, 2018
by
Chris Hines
Browse files
use random.choice for compat with python3.5
parent
57ab0a24
Changes
1
Hide whitespace changes
Inline
Side-by-side
sshshare_ws/endpoints.py
View file @
3bcb2865
...
...
@@ -36,7 +36,9 @@ class ShareStoreAPI(Resource):
value
=
json
.
dumps
(
postdata
)
logger
.
debug
(
"post value {}"
.
format
(
value
))
while
not
acceptedkey
:
key
=
''
.
join
(
random
.
choices
(
string
.
ascii_uppercase
+
string
.
digits
,
k
=
16
))
key
=
''
for
i
in
range
(
0
,
16
):
key
=
key
+
random
.
choice
(
string
.
ascii_uppercase
+
string
.
digits
)
try
:
newsd
=
ShareData
(
key
=
key
,
value
=
value
)
db_session
.
add
(
newsd
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment