@@ -86,24 +86,26 @@ def _hide_recommendations(user):
8686
8787# Gamification feature flag logic
8888from .model .user import User
89+ from .model .cohort import Cohort
8990from datetime import datetime , date
90-
91- from zeeguu .core .model import user
9291GAMIFICATION_START_DATE = date (2026 , 4 , 1 )
9392def _gamification (user : User ):
9493 """
95- Enable general gamification features for users whose invitation code is exactly 'gamification'.
94+ Enable general gamification features for users whose invitation with the gamification invite code,
95+ or who are in the gamification cohort. This includes features like badges, friends, and leaderboards.
9696 """
9797
98- GAMIFICATION_INVITE_CODE = "gamification "
98+ GAMIFICATION_INVITE_CODE = "CD8HGKKJ "
9999 if user .is_dev :
100100 return True
101101
102- # Only enable after the start date
103- if not _has_gamification_started ():
104- return False
105-
106- return user .invitation_code == GAMIFICATION_INVITE_CODE
102+ if user .invitation_code .lower () == GAMIFICATION_INVITE_CODE .lower ():
103+ return True
104+
105+ # Find gamification cohort by invite code
106+ gamification_cohort = Cohort .find_by_code (GAMIFICATION_INVITE_CODE )
107+ if gamification_cohort and user .is_member_of_cohort (gamification_cohort .id ):
108+ return True
107109
108- def _has_gamification_started ():
109- return datetime . now (). date () >= GAMIFICATION_START_DATE
110+ # Disabled for everyone else
111+ return False
0 commit comments