multiple_domains

pull/17/head
kthouky 2023-08-08 12:04:42 +02:00
parent 987a8e2d58
commit de35d211e0
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ api.add_resource(activitypub.Inbox, "/inbox/<string:username>")
api.add_resource(whitelist.Whitelist, "/whitelist") api.add_resource(whitelist.Whitelist, "/whitelist")
api.add_resource(whitelist.WhitelistDomain, "/whitelist/<string:domain>") api.add_resource(whitelist.WhitelistDomain, "/whitelist/<string:domain>")
api.add_resource(endorsements.Endorsements, "/endorsements/<string:domain>") api.add_resource(endorsements.Endorsements, "/endorsements/<string:domain>")
api.add_resource(endorsements.Approvals, "/approvals/<string:domains>") api.add_resource(endorsements.Approvals, "/approvals/<string:domains_csv>")
api.add_resource(guarantees.Guarantors, "/guarantors/<string:domain>") api.add_resource(guarantees.Guarantors, "/guarantors/<string:domain>")
api.add_resource(guarantees.Guarantees, "/guarantees/<string:domain>") api.add_resource(guarantees.Guarantees, "/guarantees/<string:domain>")
api.add_resource(badges.GuaranteeBadge, "/badges/guarantees/<string:domain>.svg") api.add_resource(badges.GuaranteeBadge, "/badges/guarantees/<string:domain>.svg")

View File

@ -11,12 +11,12 @@ class Approvals(Resource):
@cache.cached(timeout=10, query_string=True) @cache.cached(timeout=10, query_string=True)
@api.marshal_with(models.response_model_model_Whitelist_get, code=200, description='Instances', skip_none=True) @api.marshal_with(models.response_model_model_Whitelist_get, code=200, description='Instances', skip_none=True)
@api.response(404, 'Instance not registered', models.response_model_error) @api.response(404, 'Instance not registered', models.response_model_error)
def get(self, domains): def get(self, domains_csv):
'''Display all endorsements given out by one or more domains '''Display all endorsements given out by one or more domains
You can pass a comma-separated list of domain names and the results will be a set of all their You can pass a comma-separated list of domain names and the results will be a set of all their
endorsements together. endorsements together.
''' '''
domains_list = domains.split(',') domains_list = domains_csv.split(',')
self.args = self.get_parser.parse_args() self.args = self.get_parser.parse_args()
instances = database.find_multiple_instance_by_domains(domains_list) instances = database.find_multiple_instance_by_domains(domains_list)
if not instances: if not instances: