(self)
| 334 | path = "/addauthor" |
| 335 | |
| 336 | def POST(self): |
| 337 | if not (get_current_user()): |
| 338 | raise web.unauthorized() |
| 339 | i = web.input("name") |
| 340 | if len(i.name) < 2: |
| 341 | return web.badrequest() |
| 342 | key = web.ctx.site.new_key("/type/author") |
| 343 | web.ctx.path = key |
| 344 | web.ctx.site.save( |
| 345 | {"key": key, "name": i.name, "type": {"key": "/type/author"}}, |
| 346 | comment="New Author", |
| 347 | action="create-author", |
| 348 | ) |
| 349 | raise web.HTTPError("200 OK", {}, key) |
| 350 | |
| 351 | |
| 352 | class clonebook(delegate.page): |
nothing calls this directly
no test coverage detected