flake8
-
reviewboard/reviews/management/commands/clean-orphaned-data.py (Diff revision 1)
Review Request #13740 — Created April 18, 2024 and submitted
This change adds a new management command that will clean up various
pieces of data in the database and filesystem that could have been left
behind if administrators used the "Delete Permanently" action on a
review request or deleted review requests via the admin UI.It will query each of the affected items to get a total count, and then
perform the actual deletion in batches. This allows us to show nice
progress bars, as well as make the command interruptible.
Populated my database with a bunch of data including screenshots,
file attachments, diffs, and change descriptions. Temporarily disabled
our new signal handler and deleted the review requests.
Summary | ID |
---|---|
e45b6c7f2d5c4d59c0c67d381f2cbf62dffef994 |
Description | From | Last Updated |
---|---|---|
continuation line over-indented for visual indent Column: 21 Error code: E127 |
reviewbot | |
We should go with "data" or "objects" here instead of "file attachments" to be more general. Same with the module … |
maubin | |
This should be taken out. |
maubin | |
This is missing a ::. |
chipx86 | |
I think this needs to be gettext_lazy. |
chipx86 | |
Small nit: One per line would help keep this readable/more maintainable if we need to expand upon this. |
chipx86 | |
Same here. |
chipx86 | |
Keyword-only arguments would help make this a bit more readable. |
chipx86 |
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+678) |
reviewboard/reviews/management/commands/clean-orphaned-data.py (Diff revision 2) |
---|
We should go with "data" or "objects" here instead of "file attachments" to be more general. Same with the module docstring too.
reviewboard/reviews/management/commands/clean-orphaned-data.py (Diff revision 2) |
---|
This should be taken out.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+672) |
This looks good.
Some small suggestions to help with readability, but overall looks good.
As a suggestion for a possible feature, it might be nice to be able to get a list of the IDs for each type of object that's going to be deleted so it can be audited or manually dealt with prior to actually invoking a deletion. But not a blocker for this change by any means.
reviewboard/reviews/management/commands/clean-orphaned-data.py (Diff revision 3) |
---|
I think this needs to be
gettext_lazy
.
reviewboard/reviews/management/commands/clean-orphaned-data.py (Diff revision 3) |
---|
Small nit: One per line would help keep this readable/more maintainable if we need to expand upon this.
reviewboard/reviews/management/commands/clean-orphaned-data.py (Diff revision 3) |
---|
Keyword-only arguments would help make this a bit more readable.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+690) |