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
72cc63fe
authored
Sep 10, 2015
by
Estók Dániel
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
dc1a5179
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
circle/setty/storage.py
+1
-0
circle/setty/views.py
+3
-2
No files found.
circle/setty/storage.py
View file @
72cc63fe
...
@@ -2,6 +2,7 @@ from django.core.files.storage import FileSystemStorage
...
@@ -2,6 +2,7 @@ from django.core.files.storage import FileSystemStorage
from
django.conf
import
settings
from
django.conf
import
settings
import
os
import
os
class
OverwriteStorage
(
FileSystemStorage
):
class
OverwriteStorage
(
FileSystemStorage
):
def
get_available_name
(
self
,
name
):
def
get_available_name
(
self
,
name
):
if
self
.
exists
(
name
):
if
self
.
exists
(
name
):
...
...
circle/setty/views.py
View file @
72cc63fe
...
@@ -21,7 +21,7 @@ class IndexView(TemplateView):
...
@@ -21,7 +21,7 @@ class IndexView(TemplateView):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
if
self
.
request
.
user
.
is_authenticated
():
if
self
.
request
.
user
.
is_authenticated
():
return
TemplateView
.
get
(
self
,
request
,
*
args
,
**
kwargs
)
# To be checked!
return
TemplateView
.
get
(
self
,
request
,
*
args
,
**
kwargs
)
else
:
else
:
return
redirect
(
auth
.
views
.
login
)
return
redirect
(
auth
.
views
.
login
)
...
@@ -113,7 +113,8 @@ class DetailView(IndexView):
...
@@ -113,7 +113,8 @@ class DetailView(IndexView):
try
:
try
:
serviceObject
=
Service
.
objects
.
get
(
id
=
kwargs
[
'pk'
])
serviceObject
=
Service
.
objects
.
get
(
id
=
kwargs
[
'pk'
])
if
serviceObject
.
user
!=
self
.
request
.
user
:
if
serviceObject
.
user
!=
self
.
request
.
user
:
return
HttpResponseForbidden
(
"You don't have permission to open the service."
)
return
HttpResponseForbidden
(
"You don't have permission to open the service."
)
except
:
except
:
raise
Http404
raise
Http404
else
:
else
:
...
...
Kálmán Viktor
@kviktor
commented
Sep 13, 2015
Owner
commit name:
https://git.ik.bme.hu/circle/cloud/wikis/CodingStyle
commit name: https://git.ik.bme.hu/circle/cloud/wikis/CodingStyle
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