Commit 72cc63fe by Estók Dániel

Cleanup

parent dc1a5179
...@@ -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):
......
...@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment