Commit 156b9657 by Fábián János

better bug fix:Transfer ownership

parent 8668bbfe
...@@ -1433,7 +1433,7 @@ class AclUserOrGroupAddForm(forms.Form): ...@@ -1433,7 +1433,7 @@ class AclUserOrGroupAddForm(forms.Form):
class TransferOwnershipForm(forms.Form): class TransferOwnershipForm(forms.Form):
name = autocomplete.Select2ListChoiceField( name = autocomplete.Select2ListCreateChoiceField(
widget=autocomplete.ListSelect2( widget=autocomplete.ListSelect2(
url='autocomplete.acl.user', url='autocomplete.acl.user',
attrs={'class': 'form-control', attrs={'class': 'form-control',
...@@ -1442,6 +1442,7 @@ class TransferOwnershipForm(forms.Form): ...@@ -1442,6 +1442,7 @@ class TransferOwnershipForm(forms.Form):
label=_("E-mail address or identifier of user")) label=_("E-mail address or identifier of user"))
class AddGroupMemberForm(forms.Form): class AddGroupMemberForm(forms.Form):
new_member = autocomplete.Select2ListChoiceField( new_member = autocomplete.Select2ListChoiceField(
widget=autocomplete.ListSelect2( widget=autocomplete.ListSelect2(
......
...@@ -632,7 +632,7 @@ class TransferOwnershipView(CheckedDetailView, DetailView): ...@@ -632,7 +632,7 @@ class TransferOwnershipView(CheckedDetailView, DetailView):
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
form = TransferOwnershipForm(request.POST) form = TransferOwnershipForm(request.POST)
if request.POST.get('name') is None: if not form.is_valid():
return self.get(request) return self.get(request)
try: try:
new_owner = search_user(request.POST['name']) new_owner = search_user(request.POST['name'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment