-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove content transmission audits without a catalog uuid (#1793)
* feat: remove transmission audits without catalog uuids * fix: updated changelog * fix: bumped version * fix: updated test
- Loading branch information
1 parent
d13c093
commit aa37d50
Showing
5 changed files
with
92 additions
and
1 deletion.
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
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
30 changes: 30 additions & 0 deletions
30
...hannels/integrated_channel/management/commands/remove_null_catalog_transmission_audits.py
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
""" | ||
Remove content transmission audit records that do not contain a catalog UUID. | ||
""" | ||
import logging | ||
|
||
from django.core.management.base import BaseCommand | ||
|
||
from integrated_channels.integrated_channel.management.commands import IntegratedChannelCommandMixin | ||
from integrated_channels.integrated_channel.tasks import remove_null_catalog_transmission_audits | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
class Command(IntegratedChannelCommandMixin, BaseCommand): | ||
""" | ||
Remove content transmission audit records that do not contain a catalog UUID. | ||
./manage.py lms remove_null_catalog_transmission_audits | ||
""" | ||
|
||
def handle(self, *args, **options): | ||
""" | ||
Filter content transmission audit records that do not contain a catalog UUID and remove them. | ||
""" | ||
try: | ||
remove_null_catalog_transmission_audits.delay() | ||
except Exception as exc: # pylint: disable=broad-except | ||
LOGGER.exception( | ||
f'''Failed to remove content transmission audits that do not | ||
contain a catalog UUID. Task failed with exception: {exc}''' | ||
) |
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