Skip to content

Commit a51b955

Browse files
committed
make sure contentprovider lookup dict exists
1 parent 834a97f commit a51b955

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

server/workers/api/src/apis/base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,16 @@ class ContentProvider(Resource):
111111
@base_ns.produces(["application/json"])
112112
def post(self):
113113
"""
114-
params: can be empty
115-
content_provider: BASE internal name, e.g. "ftunivlausanne"
114+
params: can be empty, or {"repo": "ft..."}, BASE internal name, e.g. "ftunivlausanne"
116115
117116
returns: json
118-
{"contentprovider_short": "ftunivlausanne",
119-
"repo_name": "Université de Lausanne (UNIL): Serval - Serveur académique lausannois"}
117+
{"repo_name": "Université de Lausanne (UNIL): Serval - Serveur académique lausannois"}
120118
"""
121119
params = request.get_json()
122120
base_ns.logger.debug(params)
121+
if not contentprovider_lookup:
122+
global contentprovider_lookup
123+
contentprovider_lookup = get_or_create_contentprovider_lookup()
123124
if not params:
124125
result = contentprovider_lookup
125126
else:

0 commit comments

Comments
 (0)