Add userName and userEmail to init objects in base.html (#2082)

* Add `userName` and `userEmail` to the CTFd init object in `base.html`
* Closes #2066
This commit is contained in:
Kevin Chung
2022-04-08 15:14:57 -04:00
committed by GitHub
parent e526d60a6d
commit 0c6e28315c
3 changed files with 16 additions and 0 deletions

View File

@@ -61,6 +61,10 @@ def test_hidden_user_visibility():
r = client.get("/users")
response = r.get_data(as_text=True)
# Only search in body content
body_start = response.find("<body>")
body_end = response.find("</body>")
response = response[body_start:body_end]
assert user_name not in response
r = client.get("/api/v1/users")
@@ -71,6 +75,10 @@ def test_hidden_user_visibility():
r = client.get("/scoreboard")
response = r.get_data(as_text=True)
# Only search in body content
body_start = response.find("<body>")
body_end = response.find("</body>")
response = response[body_start:body_end]
assert user_name not in response
r = client.get("/api/v1/scoreboard")
@@ -85,6 +93,10 @@ def test_hidden_user_visibility():
r = client.get("/users")
response = r.get_data(as_text=True)
# Only search in body content
body_start = response.find("<body>")
body_end = response.find("</body>")
response = response[body_start:body_end]
assert user_name in response
r = client.get("/api/v1/users")