Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
f4ba0c92
authored
Jul 10, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix store toplist refresh
parent
f1063e30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
circle/dashboard/views.py
+5
-4
No files found.
circle/dashboard/views.py
View file @
f4ba0c92
...
@@ -209,14 +209,15 @@ class IndexView(LoginRequiredMixin, TemplateView):
...
@@ -209,14 +209,15 @@ class IndexView(LoginRequiredMixin, TemplateView):
# toplist
# toplist
user_home
=
"u-
%
d"
%
user
.
pk
user_home
=
"u-
%
d"
%
user
.
pk
cache_key
=
"toplist-
%
s"
%
user_home
cache
=
get_cache
(
"default"
)
cache
=
get_cache
(
"default"
)
toplist
=
cache
.
get
(
"toplist-
%
s"
%
user_home
)
toplist
=
cache
.
get
(
cache_key
)
if
not
toplist
:
if
not
toplist
:
try
:
try
:
toplist
=
store_api
.
process_list
(
store_api
.
toplist
(
user_home
))
toplist
=
store_api
.
process_list
(
store_api
.
toplist
(
user_home
))
except
Http404
:
except
Http404
:
toplist
=
[]
toplist
=
[]
cache
.
set
(
"toplist-
%
s"
%
user_home
,
toplist
,
300
)
cache
.
set
(
cache_key
,
toplist
,
300
)
context
[
'toplist'
]
=
toplist
context
[
'toplist'
]
=
toplist
...
@@ -3190,12 +3191,12 @@ def store_new_directory(request):
...
@@ -3190,12 +3191,12 @@ def store_new_directory(request):
@login_required
@login_required
def
store_refresh_toplist
(
request
):
def
store_refresh_toplist
(
request
):
user_home
=
"u-
%
d"
%
request
.
user
.
pk
user_home
=
"u-
%
d"
%
request
.
user
.
pk
cache_key
=
"toplist-
%
s"
%
user_home
cache
=
get_cache
(
"default"
)
cache
=
get_cache
(
"default"
)
try
:
try
:
toplist
=
store_api
.
process_list
(
store_api
.
toplist
(
user_home
))
toplist
=
store_api
.
process_list
(
store_api
.
toplist
(
user_home
))
except
Http404
:
except
Http404
:
toplist
=
[]
toplist
=
[]
cache
.
set
(
"toplist-test"
,
toplist
,
300
)
cache
.
set
(
cache_key
,
toplist
,
300
)
user_home
=
"u-
%
d"
%
request
.
user
.
pk
return
redirect
(
reverse
(
"dashboard.index"
))
return
redirect
(
reverse
(
"dashboard.index"
))
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