(data)
| 587 | |
| 588 | |
| 589 | def validate_unique_user(data): |
| 590 | if 'username' not in data: |
| 591 | return |
| 592 | |
| 593 | exist_users = User.query.filter_by( |
| 594 | username=data['username'], |
| 595 | auth_source=data['auth_source'] |
| 596 | ).count() |
| 597 | |
| 598 | if exist_users != 0: |
| 599 | raise InternalServerError(_("User email or username must be unique " |
| 600 | "for each authentication source.")) |
| 601 | |
| 602 | |
| 603 | def validate_user(data): |