Skip to content

Fix warning in OPDS importer settings#1213

Merged
jonathangreen merged 1 commit intomainfrom
bugfix/opds-importer-warning
Jun 22, 2023
Merged

Fix warning in OPDS importer settings#1213
jonathangreen merged 1 commit intomainfrom
bugfix/opds-importer-warning

Conversation

@jonathangreen
Copy link
Member

Description

Move the _NO_DEFAULT_AUDIENCE to a private attribute.

Motivation and Context

After #1189 was merged, I am seeing this warning in the logs when starting the CM:

circulation-webapp-1  | {"host": "f0b88606839f", "app": "simplified", "name": "core.opds_import.OPDSImporterSettings", "level": "WARNING", "filename": "settings.py", "message": "NO_DEFAULT_AUDIENCE was not initialized with FormField, skipping.", "timestamp": "2023-06-21T17:32:30.378728+00:00"}
circulation-webapp-1  | {"host": "f0b88606839f", "app": "simplified", "name": "api.opds_for_distributors.OPDSForDistributorsSettings", "level": "WARNING", "filename": "settings.py", "message": "NO_DEFAULT_AUDIENCE was not initialized with FormField, skipping.", "timestamp": "2023-06-21T17:32:30.378739+00:00"}
circulation-webapp-1  | {"host": "f0b88606839f", "app": "simplified", "name": "core.opds_import.OPDSImporterSettings", "level": "WARNING", "filename": "settings.py", "message": "NO_DEFAULT_AUDIENCE was not initialized with FormField, skipping.", "timestamp": "2023-06-21T17:32:30.378760+00:00"}
circulation-webapp-1  | {"host": "f0b88606839f", "app": "simplified", "name": "core.opds2_import.OPDS2ImporterSettings", "level": "WARNING", "filename": "settings.py", "message": "NO_DEFAULT_AUDIENCE was not initialized with FormField, skipping.", "timestamp": "2023-06-21T17:32:30.378831+00:00"}
circulation-webapp-1  | {"host": "f0b88606839f", "app": "simplified", "name": "api.opds_for_distributors.OPDSForDistributorsSettings", "level": "WARNING", "filename": "settings.py", "message": "NO_DEFAULT_AUDIENCE was not initialized with FormField, skipping.", "timestamp": "2023-06-21T17:32:30.379070+00:00"}
circulation-webapp-1  | {"host": "f0b88606839f", "app": "simplified", "name": "core.opds_import.OPDSImporterSettings", "level": "WARNING", "filename": "settings.py", "message": "NO_DEFAULT_AUDIENCE was not initialized with FormField, skipping.", "timestamp": "2023-06-21T17:32:30.379103+00:00"}
circulation-webapp-1  | {"host": "f0b88606839f", "app": "simplified", "name": "api.opds_for_distributors.OPDSForDistributorsSettings", "level": "WARNING", "filename": "settings.py", "message": "NO_DEFAULT_AUDIENCE was not initialized with FormField, skipping.", "timestamp": "2023-06-21T17:32:30.379128+00:00"}
circulation-webapp-1  | {"host": "f0b88606839f", "app": "simplified", "name": "core.opds2_import.OPDS2ImporterSettings", "level": "WARNING", "filename": "settings.py", "message": "NO_DEFAULT_AUDIENCE was not initialized with FormField, skipping.", "timestamp": "2023-06-21T17:32:30.379181+00:00"}
circulation-webapp-1  | {"host": "f0b88606839f", "app": "simplified", "name": "core.opds2_import.OPDS2ImporterSettings", "level": "WARNING", "filename": "settings.py", "message": "NO_DEFAULT_AUDIENCE was not initialized with FormField, skipping.", "timestamp": "2023-06-21T17:32:30.379295+00:00"}

Moving this to a private attribute means we won't see these warnings every time we start up the CM.

How Has This Been Tested?

Testing locally in docker container.

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

Copy link
Contributor

@RishiDiwanTT RishiDiwanTT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I knew about this warning, and intended to fix it during the PR cleanup, but that got out of hand 😆

@jonathangreen jonathangreen merged commit 318f88a into main Jun 22, 2023
@jonathangreen jonathangreen deleted the bugfix/opds-importer-warning branch June 22, 2023 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants