Skip to content

Commit 58daea1

Browse files
committed
Refactoring constant, admin access fix
1 parent c359a25 commit 58daea1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

dashboard/routings/result.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
from dashboard.colors import get_color
2020

2121

22+
# Constants
23+
BUBBLE_SIZE_RATIO = 1250
24+
25+
2226
@blueprint.route('/result/<end>/heatmap')
2327
@secure
2428
def result_heatmap(end):
@@ -198,8 +202,8 @@ def get_hits_per_hour(end):
198202
def get_time_per_version_per_user(end, versions):
199203
user_data = {}
200204
data = [t.execution_time for t in get_all_measurement(end)]
201-
# compute the average for determining the default size
202-
average = math.sqrt(sum(data) / len(data))/1250
205+
# compute the average for determining the size of the bubbles in the plot
206+
average = math.sqrt(sum(data) / len(data)) / BUBBLE_SIZE_RATIO
203207

204208
for d in [str(c.group_by) for c in get_endpoint_column(end, FunctionCall.group_by)]:
205209
user_data[d] = {}

dashboard/security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def wrapper(*args, **kwargs):
3737

3838

3939
def is_admin():
40-
return session and session.pop(config.link + '_admin', False)
40+
return session and session.get(config.link + '_admin')
4141

4242

4343
def check_login(name, password):

0 commit comments

Comments
 (0)