Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:kartoza/watchkeeper into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsunni committed Aug 18, 2015
2 parents 94ee69f + 1d6043d commit d65bd09
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions django_project/event_mapper/tasks/daily_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ def daily_report():
report += 'No movement updated found in these period.\n'

logger.info(report)

# Do not send email notification if no events or movement updates
if len(events) == 0 and len(movements) == 0:
return

# Send email to all user
users = User.objects.all()
for user in users:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def movement_notify_all_users(movement_id):
movement = Movement.objects.get(id=movement_id)
users = User.objects.filter(
countries_notified__polygon_geometry__contains=
movement.boundary.polygon_geometry, notify_immediately=True)
movement.boundary.polygon_geometry)

message = movement.report()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def movement_notify_priority_users(movement_id):
movement = Movement.objects.get(id=movement_id)
users = User.objects.filter(
countries_notified__polygon_geometry__contains=
movement.boundary.polygon_geometry)
movement.boundary.polygon_geometry,
notify_immediately=True)

message = movement.report()

Expand Down

0 comments on commit d65bd09

Please sign in to comment.