Commit 4d94ff16 by Dányi Bence

store api http code

parent dcd6abfb
...@@ -6,6 +6,7 @@ from store.api import StoreApi ...@@ -6,6 +6,7 @@ from store.api import StoreApi
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User from django.contrib.auth.models import User
import os import os
import json
@login_required @login_required
def index(request): def index(request):
...@@ -17,7 +18,7 @@ def index(request): ...@@ -17,7 +18,7 @@ def index(request):
for key in request.user.sshkey_set.all(): for key in request.user.sshkey_set.all():
key_list.append(key.key) key_list.append(key.key)
except: except:
return HttpResponse('Can not acces to django database!') return HttpResponse('Can not acces to django database!', status_code=404)
if StoreApi.userexist(user) != True: if StoreApi.userexist(user) != True:
#Create user #Create user
if not StoreApi.createuser(user,password,key_list): if not StoreApi.createuser(user,password,key_list):
......
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