Пример #1
0
 def mutate(self, info, username, password, email):
     user = User.query.filter_by(username=username).first()
     if user:
         return CreateUser(user=user)
     user = User(username=username, password=password, email=email)
     if user:
         User.save(user)
     return CreateUser(user=user)
 def post(self):
     data = json.loads(request.data)
     new_user = User()
     new_user.username = data['username']
     new_user.user_email = data['user_email']
     new_user.location = data.get('location')
     _id = new_user.save()
     return str(_id.id), 201