コード例 #1
0
ファイル: views.py プロジェクト: redsolution/electroochered
 def post(self, request, backend, association_id, redirect_to):
     if request.POST.get("confirmation") == "yes":
         association = get_object_or_404(UserSocialAuth, id=association_id, user=request.user)
         disconnect(request, backend, association_id=association_id)
         profile = request.user.profile
         profile.social_auth_clean_data()
     return HttpResponseRedirect(redirect_to)
コード例 #2
0
ファイル: views.py プロジェクト: redsolution/electroochered
 def post(self, request, backend, association_id, redirect_to):
     if request.POST.get("confirmation") == "yes":
         association = get_object_or_404(UserSocialAuth, id=association_id)
         user = association.user
         # оператор может отвязывать профиль только для заявителей
         if user.is_requester():
             disconnect(request, backend, association_id=association_id)
             profile = user.profile
             profile.social_auth_clean_data()
         else:
             return HttpResponseForbidden(u"Вы можете работать только с заявителями")
     return HttpResponseRedirect(redirect_to)