This function will check user is exist or not. If exist then return
(user, from_setup, auth_source=INTERNAL)
| 862 | |
| 863 | |
| 864 | def _does_user_exist(user, from_setup, auth_source=INTERNAL): |
| 865 | """ |
| 866 | This function will check user is exist or not. If exist then return |
| 867 | """ |
| 868 | if isinstance(user, User): |
| 869 | auth_source = user.auth_source |
| 870 | user = user.username |
| 871 | |
| 872 | new_user = User.query.filter_by(username=user, |
| 873 | auth_source=auth_source).first() |
| 874 | |
| 875 | if new_user is None: |
| 876 | print(USER_NOT_FOUND % user) |
| 877 | if from_setup: |
| 878 | sys.exit(1) |
| 879 | |
| 880 | return new_user |
| 881 | |
| 882 | |
| 883 | def _handle_error(error_msg, from_setup): |
no test coverage detected