Skip to content

Commit

Permalink
api: fix admin group for notebook build
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Sep 1, 2021
1 parent bbe57ef commit ac6c6fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mpcontribs-api/mpcontribs/api/notebooks/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
notebooks = Blueprint("notebooks", __name__, template_folder=templates)

MPCONTRIBS_API_HOST = os.environ["MPCONTRIBS_API_HOST"]
ADMIN_GROUP = os.environ.get("ADMIN_GROUP", "admin")

rq = RQ()
rq.default_queue = f"notebooks_{MPCONTRIBS_API_HOST}"
Expand Down Expand Up @@ -211,7 +212,7 @@ def make(projects=None, cids=None, force=False):
nbf.new_code_cell("\n".join([
"if 'client' not in locals():",
"\tclient = Client(",
'\t\theaders={"X-Authenticated-Groups": "admin"},',
f'\t\theaders={{"X-Authenticated-Groups": "{ADMIN_GROUP}"}},',
f'\t\thost="{MPCONTRIBS_API_HOST}"',
"\t)",
"print(client.get_totals())",
Expand Down

0 comments on commit ac6c6fb

Please sign in to comment.