MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / GET

Method GET

openlibrary/plugins/openlibrary/code.py:534–549  ·  view source on GitHub ↗
(self, batch_id)

Source from the content-addressed store, hash-verified

532 path = r"/import/batch/approve/(\d+)"
533
534 def GET(self, batch_id):
535
536 user_key = delegate.context.user and delegate.context.user.key
537 if user_key not in _get_members_of_group("/usergroup/admin"):
538 raise Forbidden("Permission Denied.")
539
540 db.query(
541 """
542 UPDATE import_item
543 SET status = 'pending'
544 WHERE batch_id = $batch_id AND status = 'needs_review';
545 """,
546 vars=locals(),
547 )
548
549 return web.found(f"/import/batch/{batch_id}")
550
551
552class BatchImportPendingView(delegate.page):

Callers

nothing calls this directly

Calls 3

_get_members_of_groupFunction · 0.85
ForbiddenClass · 0.85
queryMethod · 0.45

Tested by

no test coverage detected