def feedback(self): text = request.form.get('feedback') useragent = request.headers.get('User-Agent') if len(text) > 10000: return {'error': 413}, 413 rate_limit_update(1, "feedback") if not current_app.debug and rate_limit_exceeded("feedback"): return {'error': 420}, 420 feedback = Feedback(text=text, useragent=useragent) feedback.save() return {'status': 'success'}