|
@@ -9,7 +9,7 @@ from django.forms import ModelChoiceField
|
|
|
from django.utils import timezone
|
|
|
|
|
|
from .models import ItemType, Item, Loan, Storage
|
|
|
-from coin.members.admin import MemberAdmin
|
|
|
+import coin.members.admin
|
|
|
|
|
|
|
|
|
User = get_user_model()
|
|
@@ -181,7 +181,8 @@ class LoanInline(admin.TabularInline):
|
|
|
def has_delete_permission(self, request, obj=None):
|
|
|
return False
|
|
|
|
|
|
-# Avoid to add LoanInline twice in case the file is loaded more than
|
|
|
-# once.
|
|
|
-if LoanInline not in MemberAdmin.inlines:
|
|
|
- MemberAdmin.inlines.append(LoanInline)
|
|
|
+class MemberAdmin(coin.members.admin.MemberAdmin):
|
|
|
+ inlines = coin.members.admin.MemberAdmin.inlines + [LoanInline]
|
|
|
+
|
|
|
+admin.site.unregister(coin.members.admin.Member)
|
|
|
+admin.site.register(coin.members.admin.Member, MemberAdmin)
|