Skip to content
Browse files

stats shouldn't depend on vulnerability

  • Loading branch information...
1 parent 31a7f69 commit f1383906105fc3756a61f0f224bb19689cd407d0 @flavour committed Oct 4, 2012
Showing with 6 additions and 4 deletions.
  1. +1 −1 VERSION
  2. +5 −3 modules/eden/stats.py
View
2 VERSION
@@ -1 +1 @@
-81ba345 (2012-10-04 17:44:22)
+31a7f69 (2012-10-04 19:07:25)
View
8 modules/eden/stats.py
@@ -290,7 +290,6 @@ def stats_update_time_aggregate(cls, data_id=None):
s3db = current.s3db
dtable = s3db.stats_data
atable = s3db.stats_aggregate
- s3db.vulnerability_data
stats_aggregated_period = cls.stats_aggregated_period
@@ -488,6 +487,8 @@ def stats_update_time_aggregate(cls, data_id=None):
parents = current.gis.get_parents(location_id)
async = current.s3task.async
loc_level = s3db.gis_location[location_id].level
+ if current.deployment_settings.has_module("vulnerability"):
+ vulnerability = True
for (start_date, end_date) in changed_periods:
s, e = str(start_date), str(end_date)
@@ -498,8 +499,9 @@ def stats_update_time_aggregate(cls, data_id=None):
async("stats_update_aggregate_location",
args = [loc_level, location.id, parameter_id, s, e])
- if parameter_id in s3db.vulnerability_ids() or \
- parameter_id == s3db.vulnerability_resilience_id():
+ if vulnerability and \
+ (parameter_id in s3db.vulnerability_ids() or \
+ parameter_id == s3db.vulnerability_resilience_id()):
s3db.vulnerability_update_resilience(loc_level,
location_id,
start_date,

0 comments on commit f138390

Please sign in to comment.
Something went wrong with that request. Please try again.