Deprecates storing user type in session (#1323)

* Deprecates storing session["type"] as a means of referring to the user's current level. Instead you should refer to the database.
* Adds `CTFd.utils.user.get_current_user_type()` to get the current user's type or return None if the user is unauthed. 
* Closes #1279
This commit is contained in:
Kevin Chung
2020-04-15 03:04:18 -04:00
committed by GitHub
parent c21707c14d
commit 578b5261b2
9 changed files with 24 additions and 18 deletions

View File

@@ -213,7 +213,6 @@ def test_dynamic_challenge_loses_value_properly():
with client.session_transaction() as sess:
sess["id"] = team_id
sess["name"] = name
sess["type"] = "user"
sess["email"] = email
sess["nonce"] = "fake-nonce"
@@ -306,7 +305,6 @@ def test_dynamic_challenge_value_isnt_affected_by_hidden_users():
with client.session_transaction() as sess:
sess["id"] = team_id
sess["name"] = name
sess["type"] = "user"
sess["email"] = email
sess["nonce"] = "fake-nonce"