Exemplo n.º 1
0
def candidate(uid):
    user = savvy_collection.find_one({ '_id': ObjectId(uid) })
    if user and user.get(CATEGORY) == CAND:
        return render('candidate.html', extra=user)
    else:
        flash('Invalid access to account', 'error')
        return redirect(url_for('home'))
Exemplo n.º 2
0
Arquivo: add.py Projeto: Weizzz/CScan
def add():

    form = regoForm(request.form)
    if request.method == 'POST' and form.validate():
        return redirect(url_for('home'))

    return render('add.html', form=form)
Exemplo n.º 3
0
def recover():
    if current_user and current_user.is_authenticated:
        return redirect(url_for('home'))

    form = recoverForm(request.form)
    if request.method == 'POST' and form.validate():
        return redirect(url_for('login'))
    return render('recover.html', form=form)
Exemplo n.º 4
0
def change():
    email = request.form[EMAIL]
    user = savvy_collection.find_one({ EMAIL: email })
    form=None
    if email:
        if user:
            form = changepasswordForm(request.form,user)

            if request.method == 'GET':
                return render('changepassword.html', form=form)

            if request.method == 'POST' and form.validate():
                print('validated')
                return redirect(url_for('home'))

        return render('changepassword.html', form=form, extra=email)
    else:
        return redirect(url_for('home'))
Exemplo n.º 5
0
def register():
    if current_user and current_user.is_authenticated:
        return redirect(url_for("home"))

    form = regoForm(request.form)
    if request.method == "POST" and form.validate():
        return redirect(url_for("account"))

    return render("register.html", form=form)
Exemplo n.º 6
0
def change():
    email = request.form[EMAIL]
    user = savvy_collection.find_one({EMAIL: email})
    form = None
    if email:
        if user:
            form = changepasswordForm(request.form, user)

            if request.method == 'GET':
                return render('changepassword.html', form=form)

            if request.method == 'POST' and form.validate():
                print('validated')
                return redirect(url_for('home'))

        return render('changepassword.html', form=form, extra=email)
    else:
        return redirect(url_for('home'))
Exemplo n.º 7
0
def jobSearch():
    # display all jobs
    jobs = jobs_collection.find()
    jobsDict = {}
    for elements in jobs:
        elements.pop('employerId', None)
        elements.pop('_id', None)
        jobsDict.update(elements)

    return render('jobSearch.html', extra=jobsDict)
Exemplo n.º 8
0
def changepassword(email, password):
    user = savvy_collection.find_one({ EMAIL: email })
    form = changepasswordForm(request.form,user)

    if user:
        if User.validate_password(email, password):
            print (user)
            print('validated')
            print(current_user.get_id())
            return render('changepassword.html', form=form, extra=email)

    return redirect(url_for('home'))
Exemplo n.º 9
0
def changepassword(email, password):
    user = savvy_collection.find_one({EMAIL: email})
    form = changepasswordForm(request.form, user)

    if user:
        if User.validate_password(email, password):
            print(user)
            print('validated')
            print(current_user.get_id())
            return render('changepassword.html', form=form, extra=email)

    return redirect(url_for('home'))
Exemplo n.º 10
0
def postJob():
    email = current_user.get_id()[EMAIL]
    user = savvy_collection.find_one({EMAIL: email})
    if user and user.get(CATEGORY, None) == EMPL:
        form = jobForm(request.form)

        if request.method == 'POST' and form.validate():
            form.update(user)
            flash('successfully updated your job post', 'success')
            return redirect(url_for('account') + '#step4')

        return render('job.html', form=form)
    else:
        flash('Invalid access to account', 'error')
        return redirect(url_for('home'))
Exemplo n.º 11
0
def postJob():
    email = current_user.get_id()[EMAIL]
    user = savvy_collection.find_one({ EMAIL: email })
    if user and user.get(CATEGORY, None) == EMPL:
        form = jobForm(request.form)

        if request.method == 'POST' and form.validate():
            form.update(user)
            flash('successfully updated your job post', 'success')
            return redirect(url_for('account') + '#step4')

        return render('job.html', form = form)
    else:
        flash('Invalid access to account', 'error')
        return redirect(url_for('home'))
Exemplo n.º 12
0
def login():
    # Case: user is already logged in
    if current_user and current_user.is_authenticated:
        return redirect(url_for('home'))

    # Case: user submits form
    form = loginForm(request.form)
    if request.method == 'POST' and form.validate():
        print('validated')
        if request.form.get('next') != None and request.form.get('next') != 'None':
            return redirect(request.form.get('next'))
        else:
            return redirect(url_for('account'))

    # Case: user needs to log in
    return render('login.html', form)
Exemplo n.º 13
0
def login():
    # Case: user is already logged in
    if current_user and current_user.is_authenticated:
        return redirect(url_for('home'))

    # Case: user submits form
    form = loginForm(request.form)
    if request.method == 'POST' and form.validate():
        print('validated')
        if request.form.get('next') != None and request.form.get(
                'next') != 'None':
            return redirect(request.form.get('next'))
        else:
            return redirect(url_for('account'))

    # Case: user needs to log in
    return render('login.html', form)
Exemplo n.º 14
0
def account():
    user = savvy_collection.find_one({ EMAIL: current_user.get_id()[EMAIL] })
    userJob = jobs_collection.find_one({'employerId': user.get('_id', '')})
    if user:
        form = None
        if user.get(CATEGORY, '') == EMPL:
            form = employerForm(user, request.form)
        elif user.get(CATEGORY, '') == CAND:
            form = candidateForm(user, request.form)

        if request.method == 'GET':
            form.prepopulate(user)

        if request.method == 'POST':
            if form.validate():
                form.update(user.get(EMAIL))

        return render('account.html', form=form,
                                      error=None,
                                      jsonObject=None,
                                      extra=userJob)
    else:
        flash('Invalid access to account', 'error')
        return redirect(url_for('home'))
Exemplo n.º 15
0
def about():
    return render('aboutus.html')
Exemplo n.º 16
0
def terms():
    return render('terms.html')
Exemplo n.º 17
0
def test():
    return render('test.html')
Exemplo n.º 18
0
def homejobseekers():
    return render('homejobseekers.html', extra='homejobseekers')
Exemplo n.º 19
0
def search():
    # Query all available candidates
    candidates = savvy_collection.find({ CATEGORY: CAND }) 
    return render('search.html', jsonObject=candidates)
Exemplo n.º 20
0
def home():
    return render("home.html")
Exemplo n.º 21
0
def search():
    # Query all available candidates
    candidates = savvy_collection.find({CATEGORY: CAND})
    return render('search.html', jsonObject=candidates)
Exemplo n.º 22
0
def homejobseekers():
    return render('homejobseekers.html', extra='homejobseekers')
Exemplo n.º 23
0
def about():
    return render('aboutus.html')
Exemplo n.º 24
0
Arquivo: home.py Projeto: Weizzz/CScan
def home():
    return render('index.html', extra='')
Exemplo n.º 25
0
Arquivo: list.py Projeto: Weizzz/CScan
def list():

    # Query all available candidates
    agencies = agency_collection.find()
    return render('list.html', jsonObject=agencies)
Exemplo n.º 26
0
def home():
    return render('home.html', extra='')
Exemplo n.º 27
0
def test():
    return render('test.html')
Exemplo n.º 28
0
def home():
    return render('home.html', extra='')
Exemplo n.º 29
0
def terms():
    return render('terms.html')