-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: Added a bug fix when registering new models #3453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Added a bug fix when registering new models #3453
Conversation
# warn if the object's providerid already exists but proceed with registration | ||
if existing_obj and existing_obj.provider_id == obj.provider_id: | ||
return False | ||
logger.warning( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should warn if the provider is different -- that means an existing object is switching a provider and is perhaps a cause for concern / unanticipated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ashwinb Updated the check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit: this message isn't quite readable. can you make it more succinct please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@omaryashraf5 @ashwinb the warning will not be visible to anyone but the stack admin. imho, the right behavior is to reject the change with a message that the caller can see. the message should suggest unregistering first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
What does this PR do?
Modified the code in registry.py.
The key changes are:
return False
statement