|
@@ -9,6 +9,7 @@ from django.contrib.auth.models import Group, Permission
|
|
|
from django.contrib.contenttypes.models import ContentType
|
|
|
from django.http import HttpResponseRedirect
|
|
|
from django.conf.urls import url
|
|
|
+from django.conf import settings
|
|
|
from django.db.models.query import QuerySet
|
|
|
from django.core.urlresolvers import reverse
|
|
|
from django.utils.html import format_html
|
|
@@ -109,14 +110,13 @@ class MemberAdmin(UserAdmin):
|
|
|
|
|
|
# if obj is null then it is a creation, otherwise it is a modification
|
|
|
if obj:
|
|
|
- return (
|
|
|
+ fieldsets = (
|
|
|
('Adhérent', {'fields': (
|
|
|
('status', 'date_joined', 'resign_date'),
|
|
|
'type',
|
|
|
('first_name', 'last_name', 'nickname'),
|
|
|
'organization_name',
|
|
|
- 'comments',
|
|
|
- 'balance' # XXX we shouldn't need this, the default value should be used
|
|
|
+ 'comments'
|
|
|
)}),
|
|
|
coord_fieldset,
|
|
|
auth_fieldset,
|
|
@@ -124,18 +124,20 @@ class MemberAdmin(UserAdmin):
|
|
|
(None, {'fields': ('date_last_call_for_membership_fees_email',)})
|
|
|
)
|
|
|
else:
|
|
|
- return (
|
|
|
+ fieldsets = (
|
|
|
('Adhérent', {'fields': (
|
|
|
('status', 'date_joined'),
|
|
|
'type',
|
|
|
('first_name', 'last_name', 'nickname'),
|
|
|
'organization_name',
|
|
|
- 'comments',
|
|
|
- 'balance')}),
|
|
|
+ 'comments')}),
|
|
|
coord_fieldset,
|
|
|
auth_fieldset,
|
|
|
perm_fieldset
|
|
|
)
|
|
|
+ if settings.HANDLE_BALANCE:
|
|
|
+ fieldsets[0][1]['fields'] += ('balance',)
|
|
|
+ return fieldsets
|
|
|
|
|
|
radio_fields = {"type": admin.HORIZONTAL}
|
|
|
|