예제 #1
0
    def get(self, tag_uuid):
        user = User({"tag_uuid": tag_uuid})
        user.init_from_mongo()

        if user.user_uuid is not None:
            # resp = {
            #     "user_uuid": user.user_id,
            #     "secondary_id": user.second_id,
            #     "first_name": user.first_name,
            #     "last_name": user.last_name,
            #     "mm_username": user.mm_username,
            #     "project": user.project,
            # }
            # if user.user_uuid is not None:
            return user.__dict__
        else:
            return {"error": "user not found"}, 409
예제 #2
0
 def post(self):
     # Only user_id and in_lab is needed here.
     user = User(request.json)
     user.checkin(request.json["lab_uuid"])
     return {"status": "success"}
예제 #3
0
 def post(self):
     user = User(request.json)
     mongo_functions.change_mm_username(user)
예제 #4
0
 def post(self):
     user = User(request.json)
     mongo_functions.remove_tag(user)
예제 #5
0
 def post(self):
     user = User(request.json)
     mongo_functions.make_alumni(user)
예제 #6
0
 def post(self):
     user = User(request.json)
     mongo_functions.make_administrator(user)
예제 #7
0
 def put(self):
     user_dict = request.json
     user = User(user_dict)
     return mongo_functions.add_user(user)
예제 #8
0
 def post(self):
     user = User(request.json)
     return {"status": user.authenticate()}
예제 #9
0
 def post(self):
     user = User(request.json)
     user.checkout()
     return {"status": "success"}