Skip to content

Commit

Permalink
Unbreak update_against_templates with goals
Browse files Browse the repository at this point in the history
It was broken since b3edd98 as post_template_update and post_vc_update
signals no longer have ‘oldstats’ or ‘newstats’ args, so check for their
presence first.
  • Loading branch information
khaledhosny committed Feb 26, 2014
1 parent 9c23e70 commit c33d3fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pootle/apps/pootle_tagging/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ def flush_goal_caches(sender, **kwargs):
This signal handler is called, for example, when the TP is updated against
the templates, or a new file is uploaded, or the TP is updated from VCS.
"""
if kwargs['oldstats'] == kwargs['newstats']:
# Not all signals has stats args, so we check their presence first.
if 'oldstats' in kwargs and kwargs['oldstats'] == kwargs['newstats']:
# Nothing changed, no need to flush goal cached stats.
return
else:
Expand Down

0 comments on commit c33d3fb

Please sign in to comment.