Changeset 920890 in indico


Ignore:
Timestamp:
08/21/12 16:16:13 (9 months ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, ipv6, v0.98-series, v0.98.3, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 4c7d4152dff271ba5df5a8606605969cab454080
Children:
502503f
Parents:
456227
git-author:
Matthew Pugh <matthew.alexander.pugh@…> (07/05/12 11:07:05)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (08/21/12 16:16:13)
Message:

[MIN] Calculation Safeguard

  • Checks for data length before performing calculation
  • Avoids div/zero error in certain cases
File:
1 edited

Legend:

Unmodified
Added
Removed
  • indico/ext/statistics/piwik/queries.py

    r456227 r920890  
    307307        for each day, hence we need to build the total and average it accordingly. 
    308308        """ 
     309 
     310        if len(data) == 0: 
     311            return 0 
     312 
    309313        seconds = 0 
    310314        avgKey = 'avg_time_on_site' 
Note: See TracChangeset for help on using the changeset viewer.