def inherit_nomination(sender, instance, **kw):
 if kw.get('raw'):
  return
 addon = instance.addon
 if addon.is_packaged:
  last_ver = Version.objects.filter(addon=addon).exclude(pk=instance.pk).order_by('-nomination')
  if (last_ver.exists() and (last_ver[0].all_files[0].status == mkt.STATUS_PENDING)):
   instance.update(nomination=last_ver[0].nomination, _signal=False)
   log.debug(('[Webapp:%s] Inheriting nomination from prior pending version' % addon.id))
  elif ((addon.status in mkt.WEBAPPS_APPROVED_STATUSES) and (not instance.nomination)):
   log.debug(('[Webapp:%s] Setting nomination date to now for new version.' % addon.id))
   instance.update(nomination=datetime.datetime.now(), _signal=False)

def inherit_nomination ( sender , instance , ** kw ) : if kw . get ( 'raw' ) : return addon = instance . addon if addon . is_packaged : last_ver = Version . objects . filter ( addon = addon ) . exclude ( pk = instance . pk ) . order_by ( '-nomination' ) if ( last_ver . exists ( ) and ( last_ver [ 0 ] . all_files [ 0 ] . status == mkt . STATUS_PENDING ) ) : instance . update ( nomination = last_ver [ 0 ] . nomination , _signal = False ) log . debug ( ( '[Webapp:%s] Inheriting nomination from prior pending version' % addon . id ) ) elif ( ( addon . status in mkt . WEBAPPS_APPROVED_STATUSES ) and ( not instance . nomination ) ) : log . debug ( ( '[Webapp:%s] Setting nomination date to now for new version.' % addon . id ) ) instance . update ( nomination = datetime . datetime . now ( ) , _signal = False )
inherit nomination date for new packaged app versions .