sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[ljcom] r12632: LJSUP-13279: Implement LastPromotionInde...

Committer: vtroitsky
LJSUP-13279: Implement LastPromotionIndex class
U   trunk/cgi-bin/LJ/Pay/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Pay/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/SelfPromo.pm	2012-09-10 14:57:39 UTC (rev 12631)
+++ trunk/cgi-bin/LJ/Pay/SelfPromo.pm	2012-09-11 06:17:47 UTC (rev 12632)
@@ -13,6 +13,8 @@
 
 use LJ::Event::PromoBuyout;
 
+use LJ::Promo::LastPromotionIndex;
+
 use Sys::Hostname qw();
 
 use Exporter;
@@ -304,9 +306,6 @@
     # also only cancel the current promotion
     my $object_url;
     if ( $current_promotion ) {
-use Data::Dumper;
-warn "CURR:".Dumper($current_promotion);
-
         $class->debug_msg($slot, "current PROMO received");
         $object_url = $current_promotion->object_url;
         my $object = $current_promotion->promoted_object;
@@ -420,6 +419,13 @@
             }
         }
 
+        LJ::Promo::LastPromotionIndex->update_index($new_promotion);
+
+        if ($slot->class() eq PROMO_JOURNAL()) {
+            my $event = LJ::Event::JournalPromo->new($slot->owner, $slot->ownerid, $new_promotion->promoid);
+            $event->fire;
+        }
+
         $email_subject = $ml->("selfpromo.$object_type.notification.activate.subject", { region => $region_str });
  
         $class->debug_msg($slot, "generating the emails");

Tags: ljcom, pm, sunnyman, vtroitsky
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments