示例#1
0
def user2group_update(request, object_id):
    if request.method == "POST":
        f = forms.bsdUserToGroupForm(object_id, request.POST)
        if f.is_valid():
            f.save()
            return JsonResp(request, message=_("Groups successfully updated."))
    else:
        f = forms.bsdUserToGroupForm(userid=object_id)
    return render(
        request,
        "account/bsdgroup2user_form.html",
        {"url": reverse("account_bsduser_groups", kwargs={"object_id": object_id}), "form": f},
    )
示例#2
0
文件: views.py 项目: CsMAr51/freenas
def user2group_update(request, object_id):
    if request.method == 'POST':
        f = forms.bsdUserToGroupForm(object_id, request.POST)
        if f.is_valid():
            f.save()
            return JsonResp(request, message=_("Groups successfully updated."))
    else:
        f = forms.bsdUserToGroupForm(userid=object_id)
    return render(request, 'account/bsdgroup2user_form.html', {
        'url': reverse('account_bsduser_groups',
            kwargs={'object_id': object_id}),
        'form': f,
    })
示例#3
0
def user2group_update(request, object_id):
    if request.method == 'POST':
        f = forms.bsdUserToGroupForm(object_id, request.POST)
        if f.is_valid():
            f.save()
            return JsonResp(request, message=_("Groups successfully updated."))
    else:
        f = forms.bsdUserToGroupForm(userid=object_id)
    return render(
        request, 'account/bsdgroup2user_form.html', {
            'url':
            reverse('account_bsduser_groups', kwargs={'object_id': object_id}),
            'form':
            f,
        })