Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8ef85758
authored
Feb 10, 2013
by
x
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store: Fixed new user creation
parent
6841879c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
store/views.py
+6
-6
No files found.
store/views.py
View file @
8ef85758
...
...
@@ -11,7 +11,7 @@ import os
import
json
import
base64
def
estabilish_store_user
(
user
):
def
estabilish_store_user
(
request
,
user
):
try
:
details
=
request
.
user
.
userclouddetails_set
.
all
()[
0
]
password
=
details
.
smb_password
...
...
@@ -29,7 +29,7 @@ def estabilish_store_user(user):
def
index
(
request
):
user
=
request
.
user
.
username
if
StoreApi
.
userexist
(
user
)
!=
True
:
estabilish_store_user
(
user
)
estabilish_store_user
(
request
,
user
)
#UpdateAuthorizationInfo
try
:
auth
=
request
.
POST
[
'auth'
]
...
...
@@ -41,14 +41,14 @@ def index(request):
key_list
.
append
(
key
.
key
)
except
:
return
HttpResponse
(
'Can not acces to django database!'
,
status_code
=
404
)
if
not
StoreApi
.
updateauthorizationinfo
(
user
,
password
,
key_list
):
if
not
StoreApi
.
updateauthorizationinfo
(
user
,
password
,
key_list
):
return
HttpResponse
(
'Can not update authorization information!'
)
except
:
pass
#Download handler
try
:
dl
=
request
.
POST
[
'dl'
]
return
redirect
(
StoreApi
.
requestdownload
(
user
,
dl
))
return
redirect
(
StoreApi
.
requestdownload
(
user
,
dl
))
except
:
pass
#Upload handler
...
...
@@ -87,7 +87,7 @@ def index(request):
def
ajax_listfolder
(
request
):
user
=
request
.
user
.
username
if
StoreApi
.
userexist
(
user
)
!=
True
:
estabilish_store_user
(
user
)
estabilish_store_user
(
request
,
user
)
path
=
'/'
try
:
path
=
request
.
POST
[
'path'
]
...
...
@@ -102,7 +102,7 @@ def ajax_listfolder(request):
def
ajax_quota
(
request
):
user
=
request
.
user
.
username
if
StoreApi
.
userexist
(
user
)
!=
True
:
estabilish_store_user
(
user
)
estabilish_store_user
(
request
,
user
)
return
HttpResponse
(
json
.
dumps
(
StoreApi
.
requestquota
(
user
)))
#return HttpResponse(json.dumps({'Used':20,'Soft':160,'Hard':200}))
...
...
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