Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
258aebed
Commit
258aebed
authored
May 07, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix anonymoususer 500 error
parent
29a5d3b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
lms/djangoapps/open_ended_grading/open_ended_notifications.py
+7
-3
No files found.
lms/djangoapps/open_ended_grading/open_ended_notifications.py
View file @
258aebed
...
...
@@ -11,6 +11,7 @@ from util.cache import cache
import
datetime
from
xmodule.x_module
import
ModuleSystem
from
mitxmako.shortcuts
import
render_to_string
import
datetime
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -121,17 +122,20 @@ def combined_notifications(course, user):
success
,
notification_dict
=
get_value_from_cache
(
student_id
,
course_id
,
notification_type
)
if
success
:
return
notification_dict
if
user
.
is_authenticated
():
last_login
=
user
.
last_login
else
:
last_login
=
datetime
.
datetime
.
now
()
min_time_to_query
=
user
.
last_login
last_module_seen
=
StudentModule
.
objects
.
filter
(
student
=
user
,
course_id
=
course_id
,
modified__gt
=
min_time_to_query
)
.
values
(
'modified'
)
.
order_by
(
modified__gt
=
last_login
)
.
values
(
'modified'
)
.
order_by
(
'-modified'
)
last_module_seen_count
=
last_module_seen
.
count
()
if
last_module_seen_count
>
0
:
last_time_viewed
=
last_module_seen
[
0
][
'modified'
]
-
datetime
.
timedelta
(
seconds
=
(
NOTIFICATION_CACHE_TIME
+
60
))
else
:
last_time_viewed
=
user
.
last_login
last_time_viewed
=
last_login
pending_grading
=
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment