Ignore:
Timestamp:
Jan 3, 2021, 3:45:09 PM (6 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, master
Children:
4567d1c
Parents:
8c899f7
Message:

Several postgres fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnuboat/mapservice_impl/controllers/users_controller.py

    r8c899f7 r2175c7a  
    109109            detail='Email contains more than one @, no @ or no .'
    110110        )
     111    if len(User.query.filter_by(username=user_creation.username).all()) > 0:
     112        # Make sure, that the username is not already in use
     113        raise GnuboatBadRequest(detail='Username is already in use. Please choose another username.')
    111114    if (user_creation.license_accepted is None or
    112115            not user_creation.license_accepted):
    … …  
    114117            detail='You must accept the license to register an account'
    115118        )
     119   
    116120
    117121    # add user to the database
    … …  
    141145        activation_url=activation_url
    142146    )
    143     mail.send(message)
     147    try:
     148        mail.send(message)
     149    except:
     150        print('WARNING: Could not send mail')
    144151
    145152    return user_to_dict(user)
Note: See TracChangeset for help on using the changeset viewer.