Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@deldesir
Copy link
Collaborator

No description provided.

@holta
Copy link
Member

holta commented Mar 27, 2024

Related:

@holta
Copy link
Member

holta commented Mar 27, 2024

Explain why redundant, with screenshot or example?

@deldesir
Copy link
Collaborator Author

deldesir commented Mar 27, 2024

This log message is prone to too much repetition. Logging with the name of the shelf is enough. No need to repeat messages about every shelf with similar name found like:

A public shelf with the name 'Test' already exists
A public shelf with the name 'Test 1' already exists
A public shelf with the name 'Test 2' already exists
A public shelf with the name 'Test 3' already exists
A public shelf with the name 'Test 4' already exists
Shelf 'Test 5' added

.first() is None

if not is_shelf_name_unique:
log.error("A public shelf with the name '{}' already exists.".format(title))
Copy link
Member

@holta holta Mar 27, 2024

Choose a reason for hiding this comment

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

Any chance the line should be commented out and clarified, e.g. as follows?

# log.info("A public shelf with similar name '{}' already exists.".format(title))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

cps/shelf.py Outdated

if not is_shelf_name_unique:
log.error("A public shelf with the name '{}' already exists.".format(title))
# log.error("A public shelf with the name '{}' already exists.".format(title))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# log.error("A public shelf with the name '{}' already exists.".format(title))
# log.info("A public shelf with similar name '{}' already exists.".format(title))

Copy link
Member

Choose a reason for hiding this comment

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

Ok?

Co-authored-by: A Holt <[email protected]>
@holta holta merged commit ae1153d into iiab:master Mar 27, 2024
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