Ejemplo n.º 1
0
def insert_visitor(fname, lname, age, description, photo_path):
    """
    Depreciated. Please use serializer to insert visitors.
    :param fname: user first name
    :param lname: user last name
    :param age: user age
    :param description: user description
    :param photo_path: photo path
    :return: user object
    """
    user = User()
    user.fname = fname
    if age != "":
        user.age = age
    user.lname = lname
    user.description = description
    user.photo_path = photo_path
    user.enroll_time = timezone.now()
    user.save()
    return user