SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 89f4cc1f authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Improve admin

parent 11196b84
No related branches found
No related tags found
No related merge requests found
...@@ -35,3 +35,11 @@ class ContactAdmin(admin.ModelAdmin): ...@@ -35,3 +35,11 @@ class ContactAdmin(admin.ModelAdmin):
admin.site.register(Contact, ContactAdmin) admin.site.register(Contact, ContactAdmin)
class ContactInline(admin.TabularInline):
"""
For use as an inline in User admin.
"""
model = Contact
extra = 0
...@@ -12,6 +12,7 @@ from scipost.models import Contributor, Remark,\ ...@@ -12,6 +12,7 @@ from scipost.models import Contributor, Remark,\
AuthorshipClaim, PrecookedEmail,\ AuthorshipClaim, PrecookedEmail,\
EditorialCollege, EditorialCollegeFellowship, UnavailabilityPeriod EditorialCollege, EditorialCollegeFellowship, UnavailabilityPeriod
from organizations.admin import ContactInline
from partners.admin import ContactToUserInline from partners.admin import ContactToUserInline
from production.admin import ProductionUserInline from production.admin import ProductionUserInline
from submissions.models import Submission from submissions.models import Submission
...@@ -38,7 +39,8 @@ class ContributorInline(admin.StackedInline): ...@@ -38,7 +39,8 @@ class ContributorInline(admin.StackedInline):
class UserAdmin(UserAdmin): class UserAdmin(UserAdmin):
inlines = [ inlines = [
ContributorInline, ContributorInline,
ContactToUserInline, ContactInline,
ContactToUserInline, # TODO:PartnersDeprec remove
ProductionUserInline ProductionUserInline
] ]
list_display = ['username', 'email', 'first_name', 'last_name', list_display = ['username', 'email', 'first_name', 'last_name',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment