@login_required
@require_http_methods(['GET', 'POST'])
def remove_from_locale(request, locale_code, user_id, role):
 locale = get_object_or_404(Locale, locale=locale_code)
 user = get_object_or_404(User, id=user_id)
 if (not _user_can_edit(request.user, locale)):
  raise PermissionDenied
 if (request.method == 'POST'):
  getattr(locale, ROLE_ATTRS[role]).remove(user)
  msg = _('{user} removed from successfully!').format(user=user.username)
  messages.add_message(request, messages.SUCCESS, msg)
  return HttpResponseRedirect(locale.get_absolute_url())
 return render(request, 'wiki/confirm_remove_from_locale.html', {'locale': locale, 'leader': user, 'role': role})

@ login_required @ require_http_methods ( [ 'GET' , 'POST' ] ) def remove_from_locale ( request , locale_code , user_id , role ) : locale = get_object_or_404 ( Locale , locale = locale_code ) user = get_object_or_404 ( User , id = user_id ) if ( not _user_can_edit ( request . user , locale ) ) : raise PermissionDenied if ( request . method == 'POST' ) : getattr ( locale , ROLE_ATTRS [ role ] ) . remove ( user ) msg = _ ( '{user} removed from successfully!' ) . format ( user = user . username ) messages . add_message ( request , messages . SUCCESS , msg ) return HttpResponseRedirect ( locale . get_absolute_url ( ) ) return render ( request , 'wiki/confirm_remove_from_locale.html' , { 'locale' : locale , 'leader' : user , 'role' : role } )
remove a user from the locale role .