mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 14:34:21 +01:00
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:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user