fix: Enum capitalization in Bulk register endpoint
This commit is contained in:
@@ -253,15 +253,15 @@ async def bulk_register_students(file: UploadFile = File(...), session: Session
|
|||||||
alphabet = string.ascii_letters + string.digits
|
alphabet = string.ascii_letters + string.digits
|
||||||
password = ''.join(secrets.choice(alphabet) for i in range(8))
|
password = ''.join(secrets.choice(alphabet) for i in range(8))
|
||||||
|
|
||||||
exam = models.ExamEnum.JEE_Main
|
exam = models.ExamEnum.JEE_MAIN
|
||||||
if target_exam_str == "NEET": exam = models.ExamEnum.NEET
|
if target_exam_str == "NEET": exam = models.ExamEnum.NEET
|
||||||
elif target_exam_str == "JEE_Advanced": exam = models.ExamEnum.JEE_Advanced
|
elif target_exam_str == "JEE_Advanced": exam = models.ExamEnum.JEE_ADVANCED
|
||||||
elif target_exam_str == "JEE_NEET": exam = models.ExamEnum.JEE_NEET
|
elif target_exam_str == "JEE_NEET": exam = models.ExamEnum.JEE_NEET
|
||||||
elif target_exam_str == "JEE + NEET": exam = models.ExamEnum.JEE_NEET
|
elif target_exam_str == "JEE + NEET": exam = models.ExamEnum.JEE_NEET
|
||||||
|
|
||||||
tier = models.TierEnum.Free
|
tier = models.TierEnum.FREE
|
||||||
if tier_str == "Pro": tier = models.TierEnum.Pro
|
if tier_str == "Pro": tier = models.TierEnum.PRO
|
||||||
elif tier_str in ("Al_Coach", "AI Coach"): tier = models.TierEnum.Al_Coach
|
elif tier_str in ("Al_Coach", "AI Coach"): tier = models.TierEnum.AI_COACH
|
||||||
|
|
||||||
hashed_password = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt()).decode('utf-8')
|
hashed_password = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt()).decode('utf-8')
|
||||||
user = models.User(
|
user = models.User(
|
||||||
|
|||||||
Reference in New Issue
Block a user