File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
app/code/Magento/User/Model/ResourceModel Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -258,17 +258,17 @@ public function delete(\Magento\Framework\Model\AbstractModel $user)
258
258
259
259
$ uid = $ user ->getId ();
260
260
$ connection ->beginTransaction ();
261
- try {
262
- if ( $ uid ) {
261
+ if ( $ uid ) {
262
+ try {
263
263
$ connection ->delete ($ this ->getMainTable (), ['user_id = ? ' => $ uid ]);
264
264
$ connection ->delete (
265
265
$ this ->getTable ('authorization_role ' ),
266
266
['user_id = ? ' => $ uid , 'user_type = ? ' => UserContextInterface::USER_TYPE_ADMIN ]
267
267
);
268
+ } catch (\Magento \Framework \Exception \LocalizedException $ e ) {
269
+ $ connection ->rollBack ();
270
+ return false ;
268
271
}
269
- } catch (\Magento \Framework \Exception \LocalizedException $ e ) {
270
- $ connection ->rollBack ();
271
- return false ;
272
272
}
273
273
$ connection ->commit ();
274
274
$ this ->_afterDelete ($ user );
You can’t perform that action at this time.
0 commit comments