Beispiel #1
0
def user_status(user_id):
    user = User.query.get_or_404(user_id)
    form = StatusForm(obj=user)
    if form.validate_on_submit():
        user.timestamp = datetime.datetime.utcnow()
        form.populate_obj(user)
        db.session.commit()
        flash('Successfully updated status for user: %s' % user.name)
        return redirect(url_for('index'))
    return render_template('user/status.html', form=form)
Beispiel #2
0
def status():
    form = StatusForm(csrf_enabled=False)
    if form.validate_on_submit():
        # query bookid here:
        st = Status.query.filter_by(bk_id=form.orderid.data)
        if not st is None:
            # login user here:
            ids = ['booked', 'started', 'wash', 'wheelcare', 'checkup']
            flash('Valid id')
            return render_template('display_details.html',
                                   cur_status=st,
                                   ids=ids)
        else:
            flash('Invalid id')
            return redirect(url_for('status', _external=True))
    return render_template('status.html', form=form)
Beispiel #3
0
def status():
	form = StatusForm()

	context = {
		'form': form,
	}

	if form.validate_on_submit():
		oid = form.order_id.data

		appointment = get_appointment(oid)
		apdict = appointment.to_dict()
		context = {
			'appointment': apdict,
		}

		if appointment.to_dict() is not None:

			return render_template('checking.html', **context)
		else:
			flash('No existe la orden {}'.format(oid))
	return render_template('status.html', **context)