def add_a_resource(resource): if request.method == 'POST': resource_id = add_resource(resource = resource, request_body = request, current_user_id = current_user.id) if type(resource_id) == int or str(resource_id).isdigit(): return redirect(url_for('show_request_for_x', audience='city', request_id = request.form['request_id'])) elif resource_id == False: return render_template('error.html') else: return render_template('help_with_uploads.html', message = resource_id) return render_template('error.html', message = "You can only update requests from a request page!")
def add_a_resource(resource): if request.method == "POST": resource_id = add_resource(resource=resource, request_body=request, current_user_id=current_user.id) if type(resource_id) == int or str(resource_id).isdigit(): return redirect(url_for("show_request_for_x", audience="city", request_id=request.form["request_id"])) elif resource_id == False: return render_template("error.html") else: return render_template("help_with_uploads.html", message=resource_id) return render_template("error.html", message="You can only update requests from a request page!")
def public_add_a_resource(resource): if request.method == "POST": if "note" in resource or "subscriber" in resource: resource_id = add_resource(resource=resource, request_body=request, current_user_id=None) if type(resource_id) == int: request_id = request.form["request_id"] audience = "public" if "subscriber" in resource: audience = "follower" return redirect(url_for("show_request_for_x", audience=audience, request_id=request_id)) return render_template("error.html")
def public_add_a_resource(resource): if request.method == 'POST': if 'note' in resource or 'subscriber' in resource: resource_id = add_resource(resource = resource, request_body = request, current_user_id = None) if type(resource_id) == int: request_id = request.form['request_id'] audience = 'public' if 'subscriber' in resource: audience = 'follower' return redirect(url_for('show_request_for_x', audience=audience, request_id = request_id)) return render_template('error.html')
def add_a_resource(resource): if request.method == 'POST': resource_id = add_resource(resource = resource, request_body = request, current_user_id = current_user.id) if type(resource_id) == int or str(resource_id).isdigit(): app.logger.info("\n\nSuccessfully added resource: %s with id: %s" % (resource, resource_id)) return redirect(url_for('show_request_for_x', audience='city', request_id = request.form['request_id'])) elif resource_id == False: app.logger.info("\n\nThere was an issue with adding resource: %s" % resource) return render_template('error.html') else: app.logger.info("\n\nThere was an issue with the upload: %s" % resource_id) return render_template('help_with_uploads.html', message = resource_id) return render_template('error.html', message = "You can only update requests from a request page!")
def add_a_resource(resource): if request.method == 'POST': resource_id = add_resource(resource=resource, request_body=request.form, current_user_id=get_user_id()) if type(resource_id) == int or str(resource_id).isdigit(): app.logger.info("\n\nSuccessfully added resource: %s with id: %s" % (resource, resource_id)) return redirect( url_for('show_request_for_city', request_id=request.form['request_id'])) elif resource_id == False: app.logger.info("\n\nThere was an issue with adding resource: %s" % resource) return render_template('error.html') else: app.logger.info("\n\nThere was an issue with the upload: %s" % resource_id) return render_template('help_with_uploads.html', message=resource_id) return render_template( 'error.html', message="You can only update requests from a request page!")