def on_revision_save(sender, instance, **kwargs):
 rev = instance
 year = rev.created.year
 creator = rev.creator
 if (not rev.is_approved):
  return
 if (rev.document.locale == settings.WIKI_DEFAULT_LANGUAGE):
  badge_template = WIKI_BADGES['kb-badge']
 else:
  badge_template = WIKI_BADGES['l10n-badge']
 from kitsune.wiki.tasks import maybe_award_badge
 maybe_award_badge.delay(badge_template, year, creator)

def on_revision_save ( sender , instance , ** kwargs ) : rev = instance year = rev . created . year creator = rev . creator if ( not rev . is_approved ) : return if ( rev . document . locale == settings . WIKI_DEFAULT_LANGUAGE ) : badge_template = WIKI_BADGES [ 'kb-badge' ] else : badge_template = WIKI_BADGES [ 'l10n-badge' ] from kitsune . wiki . tasks import maybe_award_badge maybe_award_badge . delay ( badge_template , year , creator )
handle the revision save signal .