Commit 9e9f1e6
committed
Clean orphaned permissions after target delete
Cleans all orphaned Django-Guardian permissions after a Target is
deleted. This makes sense to do here as Targets can have row level
(private) permissions. We could potentially run this as well for
dataproducts, though I'm less versed on how it works there. Either way,
there's no reason to keep these objects around for any model, so it's
fine to delete permissions that aren't associated with Targets.
Alternatively, we don't do any cleanup and leave it to the TOM developer
to run the management command manually:
https://django-guardian.readthedocs.io/en/stable/api/management/1 parent f25c323 commit 9e9f1e6
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments