Skip to content

Commit

Permalink
added config sending
Browse files Browse the repository at this point in the history
  • Loading branch information
station committed Jul 25, 2016
1 parent b3d2d2a commit d5effd6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ def get(self, request, *args, **kwargs):

return render(request, 'overview.html', {'profile_list': profile_list})

class SendConfig(View):
def post(self, request, *args, **kwargs):
# get auth toiken from post

if not token in request.POST
return HttpResponse('fuckoff')
token = request.POST.get('token')
connection = get_object_or_404(Connection, token=token)
profile = Profile.objects.get(connection=connection)
if profile.connection.ptc:
auth = 'ptc'
else:
auth = 'google'
data = {
'username': profle.account.username,
'password': profile.account.password,
'auth': auth,
}
json_response = json.dumps(data)
return HttpResponse(json_response)


class Filldata(View):
def get(self, request, *args, **kwargs):
Expand Down

0 comments on commit d5effd6

Please sign in to comment.