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

Method block_ips

openlibrary/plugins/admin/code.py:502–505  ·  view source on GitHub ↗
(self, ips)

Source from the content-addressed store, hash-verified

500 raise web.seeother("/admin/block")
501
502 def block_ips(self, ips):
503 page = web.ctx.get("/admin/block") or web.ctx.site.new("/admin/block", {"key": "/admin/block", "type": "/type/object"})
504 page.ips = [{"ip": ip} for ip in ips]
505 page._save("updated blocked IPs", action="edit-blocked-ips")
506
507
508def get_blocked_ips():

Callers 2

POSTMethod · 0.95
blockMethod · 0.80

Calls 3

_saveMethod · 0.80
getMethod · 0.45
newMethod · 0.45

Tested by

no test coverage detected