Commit ae80961b authored by Florent Chehab's avatar Florent Chehab

cleaner admin.py

parent 86ee2fdf
......@@ -43,7 +43,7 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
#'general.middleware.LoginRequiredMiddleware',
'general.middleware.LoginRequiredMiddleware',
]
LOGIN_URL = '/user/login'
......
......@@ -7,13 +7,22 @@ from rex.models.university import SemestersDates
from rex.models.university import UniversityInsurance
from rex.models.location import Country, City
CLASSIC_MODELS = [
Country,
City
]
admin.site.register(Country)
admin.site.register(City)
VERSIONNED_MODELS = [
University,
Campus,
UniversityScholarship,
UniversityInfo,
SemestersDates,
UniversityInsurance
]
admin.site.register(University, CompareVersionAdmin)
admin.site.register(Campus, CompareVersionAdmin)
admin.site.register(UniversityScholarship, CompareVersionAdmin)
admin.site.register(UniversityInfo, CompareVersionAdmin)
admin.site.register(SemestersDates, CompareVersionAdmin)
admin.site.register(UniversityInsurance, CompareVersionAdmin)
for model in CLASSIC_MODELS:
admin.site.register(model)
for model in VERSIONNED_MODELS:
admin.site.register(model, CompareVersionAdmin)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment