def add(self): form = SignupForm() if request.method == 'POST' and form.validate_on_submit(): new_entry = form.make_entry() new_entry.servers = ServiceSettings.objects.all() new_entry.save() return jsonify(status='ok'), 200 return render_template('subscriber/add.html', form=form)
def subscriber_add(self, sid): form = SignupForm() if request.method == 'POST' and form.validate_on_submit(): server = ServiceSettings.objects(id=sid).first() if server: new_entry = form.make_entry() new_entry.add_server(server) server.add_subscriber(new_entry) return jsonify(status='ok'), 200 return render_template('service/subscriber/add.html', form=form)