示例#1
0
    def subscriber_edit(self, sid):
        subscriber = Subscriber.objects(id=sid).first()
        form = SignupForm(obj=subscriber)
        if request.method == 'POST' and form.validate_on_submit():
            subscriber = form.update_entry(subscriber)
            subscriber.save()
            return jsonify(status='ok'), 200

        return render_template('service/subscriber/edit.html', form=form)
示例#2
0
    def edit(self, sid):
        subscriber = _get_subscriber_by_id(sid)
        form = SignupForm(obj=subscriber)
        if request.method == 'POST' and form.validate_on_submit():
            subscriber = form.update_entry(subscriber)
            subscriber.save()
            return jsonify(status='ok'), 200

        return render_template('subscriber/edit.html', form=form)
示例#3
0
    def wedit(self, sid):
        subscriber = SubscriberUser.get_by_id(ObjectId(sid))
        form = SignupForm(obj=subscriber)
        if request.method == 'POST':
            old_password = subscriber.password
            form.validate_password(False)
            if form.validate_on_submit():
                subscriber = form.update_entry(subscriber)
                subscriber.password = old_password
                subscriber.save()
                return jsonify(status='ok'), 200

        return render_template('subscriber/wedit.html', form=form)