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
98f5a79d
Commit
98f5a79d
authored
Mar 04, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disabled profile cache -- we ran into issues
parent
cb24b172
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
4 deletions
+21
-4
cache_toolbox/core.py
+5
-0
cache_toolbox/relation.py
+4
-0
courseware/content_parser.py
+5
-1
courseware/views.py
+5
-1
student/models.py
+1
-1
student/views.py
+1
-1
No files found.
cache_toolbox/core.py
View file @
98f5a79d
...
...
@@ -58,6 +58,11 @@ def get_instance(model, instance_or_pk, timeout=None, using=None):
cache
.
delete
(
key
)
# Use the default manager so we are never filtered by a .get_query_set()
# import logging
# log = logging.getLogger("tracking")
# log.info( str(pk) )
instance
=
model
.
_default_manager
.
using
(
using
)
.
get
(
pk
=
pk
)
data
=
{}
...
...
cache_toolbox/relation.py
View file @
98f5a79d
...
...
@@ -92,6 +92,10 @@ def cache_relation(descriptor, timeout=None):
except
AttributeError
:
pass
# import logging
# log = logging.getLogger("tracking")
# log.info( "DEBUG: "+str(str(rel.model)+"/"+str(self.pk) ))
instance
=
get_instance
(
rel
.
model
,
self
.
pk
,
timeout
)
setattr
(
self
,
'_
%
s_cache'
%
related_name
,
instance
)
...
...
courseware/content_parser.py
View file @
98f5a79d
...
...
@@ -169,7 +169,11 @@ def course_xml_process(tree):
def
course_file
(
user
):
''' Given a user, return course.xml'''
filename
=
user
.
profile_cache
.
courseware
# UserProfile.objects.get(user=user).courseware
#import logging
#log = logging.getLogger("tracking")
#log.info( "DEBUG: cf:"+str(user) )
filename
=
UserProfile
.
objects
.
get
(
user
=
user
)
.
courseware
# user.profile_cache.courseware
groups
=
user_groups
(
user
)
options
=
{
'dev_content'
:
settings
.
DEV_CONTENT
,
'groups'
:
groups
}
...
...
courseware/views.py
View file @
98f5a79d
...
...
@@ -254,7 +254,7 @@ def profile(request):
]
user_info
=
request
.
user
.
profile_cache
# UserProfile.objects.get(user=request.user)
user_info
=
UserProfile
.
objects
.
get
(
user
=
request
.
user
)
# request.user.profile_cache #
context
=
{
'name'
:
user_info
.
name
,
'username'
:
request
.
user
.
username
,
'location'
:
user_info
.
location
,
...
...
@@ -345,6 +345,10 @@ def index(request, course="6.002 Spring 2012", chapter="Using the System", secti
if
course
!=
"6.002 Spring 2012"
:
return
redirect
(
'/'
)
#import logging
#log = logging.getLogger("mitx")
#log.info( "DEBUG: "+str(user) )
dom
=
content_parser
.
course_file
(
user
)
dom_module
=
dom
.
xpath
(
"//course[@name=$course]/chapter[@name=$chapter]//section[@name=$section]/*[1]"
,
course
=
course
,
chapter
=
chapter
,
section
=
section
)
...
...
student/models.py
View file @
98f5a79d
...
...
@@ -56,4 +56,4 @@ class Registration(models.Model):
self
.
user
.
save
()
#self.delete()
cache_relation
(
User
.
profile
)
#
cache_relation(User.profile)
student/views.py
View file @
98f5a79d
...
...
@@ -86,7 +86,7 @@ def logout_user(request):
def
change_setting
(
request
):
if
not
request
.
user
.
is_authenticated
():
return
redirect
(
'/'
)
up
=
request
.
user
.
profile_cache
# UserProfile.objects.get(user=request.user)
up
=
UserProfile
.
objects
.
get
(
user
=
request
.
user
)
#request.user.profile_cache
if
'location'
in
request
.
POST
:
# print "loc"
up
.
location
=
request
.
POST
[
'location'
]
...
...
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