Removed 'change password' link next to the current user's name and added a few view to handle the current user's password, details and editing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from common.utils import return_attrib
|
||||
from common.widgets import DetailSelectMultiple, PlainWidget
|
||||
@@ -92,3 +93,22 @@ class ChoiceForm(forms.Form):
|
||||
self.fields['selection'].widget.attrs.update({'size': 14, 'class': 'choice_form'})
|
||||
|
||||
selection = forms.MultipleChoiceField()
|
||||
|
||||
|
||||
class UserForm_view(DetailForm):
|
||||
"""
|
||||
Form used to display an user's public details
|
||||
"""
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ('username', 'first_name', 'last_name', 'email', 'is_staff', 'is_superuser', 'last_login', 'date_joined', 'groups')
|
||||
|
||||
|
||||
class UserForm(forms.ModelForm):
|
||||
"""
|
||||
Form used to edit an user's mininal fields by the user himself
|
||||
"""
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ('first_name', 'last_name')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user