-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(req): add django-reversion as a requirement for revisioning
- Loading branch information
Showing
4 changed files
with
20 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
from django.apps import apps | ||
from django.contrib import admin | ||
from django.contrib.auth.admin import UserAdmin | ||
from django.contrib.admin.sites import AlreadyRegistered | ||
from reversion.admin import VersionAdmin | ||
|
||
from .models import Division, League, PermissionOverrides, Season, SubDivision, User | ||
|
||
admin.site.register((Season, League, Division, SubDivision, PermissionOverrides)) | ||
admin.site.register(User, UserAdmin) | ||
app_models = apps.get_app_config("core").get_models() | ||
for model in app_models: | ||
try: | ||
admin.site.register(model, VersionAdmin) | ||
except AlreadyRegistered: # pragma: no cover | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ | |
"iarp_django_utils", | ||
"django_templated_emailer", | ||
"phonenumber_field", | ||
"reversion", | ||
] | ||
|
||
MIDDLEWARE = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,11 @@ | ||
from django.apps import apps | ||
from django.contrib import admin | ||
from django.contrib.admin.sites import AlreadyRegistered | ||
from reversion.admin import VersionAdmin | ||
|
||
from .models import ( | ||
Staff, | ||
StaffStatus, | ||
StaffStatusReason, | ||
StaffType, | ||
Team, | ||
TeamNote, | ||
TeamStatus, | ||
TeamStatusLog, | ||
) | ||
|
||
admin.site.register( | ||
( | ||
Staff, | ||
StaffStatus, | ||
StaffStatusReason, | ||
StaffType, | ||
Team, | ||
TeamNote, | ||
TeamStatus, | ||
TeamStatusLog, | ||
) | ||
) | ||
app_models = apps.get_app_config("team").get_models() | ||
for model in app_models: | ||
try: | ||
admin.site.register(model, VersionAdmin) | ||
except AlreadyRegistered: # pragma: no cover | ||
pass |