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
a2c4010b
Commit
a2c4010b
authored
Mar 10, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed caching for dev machines
parent
a8c2c3c5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletions
+13
-1
courseware/content_parser.py
+7
-1
settings.py
+1
-0
student/models.py
+5
-0
No files found.
courseware/content_parser.py
View file @
a2c4010b
...
@@ -151,7 +151,13 @@ def user_groups(user):
...
@@ -151,7 +151,13 @@ def user_groups(user):
# TODO: Rewrite in Django
# TODO: Rewrite in Django
key
=
'user_group_names_{user.id}'
.
format
(
user
=
user
)
key
=
'user_group_names_{user.id}'
.
format
(
user
=
user
)
cache_expiration
=
60
*
60
# one hour
cache_expiration
=
60
*
60
# one hour
group_names
=
cache
.
get
(
fasthash
(
key
))
# Kill caching on dev machines -- we switch groups a lot
if
"dev"
not
in
setting
.
DEFAULT_GROUPS
:
group_names
=
cache
.
get
(
fasthash
(
key
))
else
:
group_names
=
None
if
group_names
is
None
:
if
group_names
is
None
:
group_names
=
[
u
.
name
for
u
in
UserTestGroup
.
objects
.
filter
(
users
=
user
)]
group_names
=
[
u
.
name
for
u
in
UserTestGroup
.
objects
.
filter
(
users
=
user
)]
cache
.
set
(
fasthash
(
key
),
group_names
,
cache_expiration
)
cache
.
set
(
fasthash
(
key
),
group_names
,
cache_expiration
)
...
...
settings.py
View file @
a2c4010b
...
@@ -6,6 +6,7 @@ import tempfile
...
@@ -6,6 +6,7 @@ import tempfile
import
djcelery
import
djcelery
# from settings2.askbotsettings import LIVESETTINGS_OPTIONS
# from settings2.askbotsettings import LIVESETTINGS_OPTIONS
DEFAULT_GROUPS
=
[]
# Configuration option for when we want to grab server error pages
# Configuration option for when we want to grab server error pages
STATIC_GRAB
=
False
STATIC_GRAB
=
False
...
...
student/models.py
View file @
a2c4010b
...
@@ -103,3 +103,8 @@ def add_user_to_group(group, user):
...
@@ -103,3 +103,8 @@ def add_user_to_group(group, user):
utg
=
UserTestGroup
.
objects
.
get
(
name
=
group
)
utg
=
UserTestGroup
.
objects
.
get
(
name
=
group
)
utg
.
users
.
add
(
User
.
objects
.
get
(
username
=
user
))
utg
.
users
.
add
(
User
.
objects
.
get
(
username
=
user
))
utg
.
save
()
utg
.
save
()
def
remove_user_from_group
(
group
,
user
):
utg
=
UserTestGroup
.
objects
.
get
(
name
=
group
)
utg
.
users
.
add
(
User
.
objects
.
get
(
username
=
user
))
utg
.
save
()
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