Ejemplo n.º 1
0
def login(request):
    if request.method == 'GET':
        user = users.get_current_user()
        if user:
            username = user.nickname()
            allusers = User.all()
            allusers.filter("email = ", user.email())
            result = allusers.get()
            if result is None:
                u = User(nickname = user.nickname(), email = user.email(), username = "", team = "")
                u.put()
            team = Team.all()
            return render(request,"home.html",{'teams': team, 'user': result})
        else:
            return redirect(users.create_login_url("/"))
    else:
        return redirect("https://www.google.com")