Process POST request `req`.
(req, topic)
| 29 | |
| 30 | |
| 31 | def process_post_request(req, topic): |
| 32 | """ |
| 33 | Process POST request `req`. |
| 34 | """ |
| 35 | for key, val in req.form.items(): |
| 36 | if key == "": |
| 37 | if topic is None: |
| 38 | topic_name = "UNNAMED" |
| 39 | else: |
| 40 | topic_name = topic |
| 41 | cheatsheet = val |
| 42 | else: |
| 43 | if val == "": |
| 44 | if topic is None: |
| 45 | topic_name = "UNNAMED" |
| 46 | else: |
| 47 | topic_name = topic |
| 48 | cheatsheet = key |
| 49 | else: |
| 50 | topic_name = key |
| 51 | cheatsheet = val |
| 52 | |
| 53 | _save_cheatsheet(topic_name, cheatsheet) |
no test coverage detected