Exemple #1
0
def delete_stats_panes(request):
    if request.method == 'POST':
        stat_id = request.GET.get("id")
        SummaryStats.remove_user_stat(stat_id)
        return success_response([], [])
    else:
        return error_response(['Can only POST delete panes.'])
Exemple #2
0
def get_stats_panes(request):
    if request.method == 'GET':
        return JsonResponse(
            {
                'status': 1,
                'stats': SummaryStats.get_user_stats(request.user.id)
            }
        )
    else:
        return error_response(['Can only GET stat panes.'])
Exemple #3
0
 def testCouldNotCompute(self):
     generateTestFile(self.account_id, 'bad_data')
     resp = SummaryStats.generate_stats(self.account_id, 'bad_data.csv', ["mean", "min", "max", "sigma", "median"], "testtitle")
     self.assertIn(SummaryStats.COMPUTE_FAILURE, resp)
Exemple #4
0
def clear_stats(request):
    SummaryStats.clear_stats()
    return success_response([], [])