Commit 3fedefa
UFAL/Fix misleading notification when admin self-delete is rejected (#1357)
* Fix misleading message when self-delete rejection lacks a matched error text
isSelfDeletionError() matches the backend's rejection message as plain text,
but Spring Boot omits exception messages from error response bodies by
default and DSpaceBadRequestException/IllegalStateException have no
dedicated JSON-body exception handler, so the match can silently fail and
fall through to the generic, unfriendly failure notification instead of the
"you cannot delete your own account" one. Add a deterministic client-side
identity check as a fallback alongside the text match so the friendly
message shows reliably regardless of what the backend's error body contains.
Fixes dataquest-dev/dspace-customers#782
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Removed redundant comments
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Matus Kasak <matus.kasak@dataquest.sk>
(cherry picked from commit 43cf493)1 parent bd12749 commit 3fedefa
4 files changed
Lines changed: 36 additions & 4 deletions
File tree
- src/app/access-control/epeople-registry
- eperson-form
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
384 | 401 | | |
385 | 402 | | |
386 | 403 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
638 | 653 | | |
639 | 654 | | |
640 | 655 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
547 | | - | |
| 547 | + | |
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| |||
0 commit comments