mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-13 06:12:16 +00:00
Fix the blacklisting form validation
This commit is contained in:
@@ -59,4 +59,4 @@ class BlacklistUserForm(forms.Form):
|
||||
|
||||
reason = forms.CharField(required=True, widget=forms.widgets.Textarea())
|
||||
expiry_date = forms.DateTimeField(required=False, widget=SelectDateWidget())
|
||||
disable = forms.BooleanField()
|
||||
disable = forms.BooleanField(required=False)
|
||||
|
||||
@@ -328,6 +328,8 @@ def blacklist_user(request, userid):
|
||||
messages.add_message(request, messages.INFO, "User %s disabled" % u.username )
|
||||
|
||||
return redirect('sso.views.user_view', username=u.username)
|
||||
else:
|
||||
messages.add_message(request, messages.ERROR, "Error while processing the form")
|
||||
|
||||
form = BlacklistUserForm()
|
||||
return render_to_response('hr/blacklist/blacklist.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
Reference in New Issue
Block a user