(self, query)
| 891 | return query["key"] |
| 892 | |
| 893 | def verify_types(self, query): |
| 894 | if isinstance(query, list): |
| 895 | for q in query: |
| 896 | self.verify_types(q) |
| 897 | else: |
| 898 | if "type" not in query: |
| 899 | raise BadRequest("Missing type") |
| 900 | type = query["type"] |
| 901 | if isinstance(type, dict): |
| 902 | if "key" not in type: |
| 903 | raise BadRequest("Bad Type: " + json.dumps(type)) |
| 904 | type = type["key"] |
| 905 | |
| 906 | if type not in [ |
| 907 | "/type/author", |
| 908 | "/type/edition", |
| 909 | "/type/work", |
| 910 | "/type/series", |
| 911 | "/type/publisher", |
| 912 | "/type/tag", |
| 913 | ]: |
| 914 | raise BadRequest("Bad Type: " + json.dumps(type)) |
| 915 | |
| 916 | def POST(self): |
| 917 | if not can_write(): |
no test coverage detected