-
Notifications
You must be signed in to change notification settings - Fork 6
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
Misc fix / imp #49
Misc fix / imp #49
Conversation
* store full traceback in log entry * return log entry URL to ease reporting
When the backend raises an exception, can provide a log entry URL. It's now displayed in the notification message.
def _constrain_name_unique(self): | ||
for rec in self: | ||
if self.search_count([("name", "=", rec.name), ("id", "!=", rec.id)]): | ||
raise exceptions.UserError(_("Package name must be unique!")) |
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.
couldn't a SQL constraint be used?
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.
I prefer not to go for it to avoid conflicts w/ setup data and especially tests.
Also, if for any reason you want to take control of the feature, you can do it in this way.
|
||
log_entry = self._log_call_in_db(self.env, request, _id, params, result=result) | ||
log_entry_url = self._get_log_entry_url(log_entry) | ||
result["log_entry_url"] = log_entry_url |
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.
❤️
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.
Awesome cool
Commits are self-explanatory.
Major change: exceptions on dispatch now return the log entry URL to improve reporting + check pkg name is unique.
Requires OCA/rest-framework#76 to be fully functional (not broken w/out tho).