@@ -237,6 +237,10 @@ def student_autograde():
237237 """
238238 assignment_id = request .vars .assignment_id
239239 timezoneoffset = session .timezoneoffset if "timezoneoffset" in session else None
240+ if not timezoneoffset and "RS_info" in request .cookies :
241+ parsed_js = json .loads (request .cookies ["RS_info" ].value )
242+ timezoneoffset = parsed_js .get ("tz_offset" , None )
243+
240244 is_timed = request .vars .is_timed
241245
242246 if assignment_id .isnumeric () is False :
@@ -590,7 +594,10 @@ def doAssignment():
590594 if "access_token" not in request .cookies :
591595 # this means the user is logged in to web2py but not fastapi - this is not good
592596 # as the javascript in the questions assumes the new server and a token.
593- return redirect (URL ("default" , "accessIssue" ))
597+ logger .error (f"Missing Access Token: { auth .user .username } adding one Now" )
598+ _create_access_token (
599+ {"sub" : auth .user .username }, expires = datetime .timedelta (days = 30 )
600+ )
594601
595602 course = db (db .courses .id == auth .user .course_id ).select (** SELECT_CACHE ).first ()
596603 assignment_id = request .vars .assignment_id
@@ -845,6 +852,10 @@ def doAssignment():
845852 is_graded = False
846853
847854 timezoneoffset = session .timezoneoffset if "timezoneoffset" in session else None
855+ if not timezoneoffset and "RS_info" in request .cookies :
856+ parsed_js = json .loads (request .cookies ["RS_info" ].value )
857+ timezoneoffset = parsed_js .get ("tz_offset" , None )
858+
848859 timestamp = datetime .datetime .utcnow ()
849860 deadline = assignment .duedate
850861 if timezoneoffset :
@@ -886,6 +897,10 @@ def chooseAssignment():
886897 )
887898
888899 timezoneoffset = session .timezoneoffset if "timezoneoffset" in session else None
900+ if not timezoneoffset and "RS_info" in request .cookies :
901+ parsed_js = json .loads (request .cookies ["RS_info" ].value )
902+ timezoneoffset = parsed_js .get ("tz_offset" , None )
903+
889904 status = [] # This will be used to show the status of each assignment on html file
890905 duedates = [] # This will be used to display the due date for each assignment
891906
0 commit comments