holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[livejournal] r21436: LJSUP-11372: Develop regional self promo...

Committer: akanashin
LJSUP-11372: Develop regional self promo for Ukraine
U   trunk/cgi-bin/LJ/Widget/Location.pm
Modified: trunk/cgi-bin/LJ/Widget/Location.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Location.pm	2012-03-16 12:18:31 UTC (rev 21435)
+++ trunk/cgi-bin/LJ/Widget/Location.pm	2012-03-16 12:30:42 UTC (rev 21436)
@@ -4,6 +4,7 @@
 use base qw(LJ::Widget);
 use Carp qw(croak);
 use DateTime::TimeZone;
+use LJ::Widget::Shop::View::SelfPromo;
 
 my @location_props = qw/ country state city zip sidx_loc/;
 
@@ -245,6 +246,16 @@
         $class->error($class->ml('widget.location.error.locale.state_ne_country'));
     }
 
+    if ($u->prop('country') eq 'UA') {
+        for my $type (qw(entry journal community)) {
+            my $class = LJ::Pay::SelfPromo->get_class_by_type($type , 'ua');
+            my $promo = $class->current_promo_info();
+            if (LJ::u_equals($promo->promoter, $u)) {
+                $class->withdraw_object($promo->object);
+            }
+        }
+    }
+
     # zip-code validation stuff
     if ($post->{'country'} eq "US") {
         if ($post->{'statedrop'} && $zipstate && $post->{'statedrop'} ne $zipstate) {

Tags: akanashin, holyandrew, livejournal, pm
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