[ljcom] r11904: LJSUP-12005: Update console command Self...
Committer: vtroitsky
LJSUP-12005: Update console command SelfpromoU trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm 2012-05-05 14:43:23 UTC (rev 11903)
+++ trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm 2012-05-05 14:43:35 UTC (rev 11904)
@@ -155,10 +155,8 @@
}
if ( $cmd eq 'ban' ) {
- if ( $type ne PROMO_OBJECT_TYPE_ENTRY() ) {
-
+ if ( $type ne PROMO_OBJECT_TYPE_ENTRY() ) { # ensure we get users as object
my $u = $object->object; # LJ::User
-
# check all current promotions
foreach my $cc (LJ::Pay::PromotionSlot->get_all_regions()) {
foreach my $ptype qw(entry journal community) {
@@ -166,7 +164,7 @@
$slot->check_current_promotion;
my $current_promo = $slot->current_promotion();
- if ( $current_promo && ( $current_promo->is_owner($u) || $current_promo->is_promoter($u) || $current_promo->is_promoting($u)) ) {
+ if ( $current_promo && ( $current_promo->is_promoter($u) || $current_promo->is_promoting($u)) ) { # $current_promo->is_owner($u) ||
$self->info("The ban will affect the currently promoted $ptype in $cc promo, so cancelling that.");
my $current_object = $current_promo->promoted_object();
$self->_cancel_object( 'slot' => $slot, 'type' => $ptype, 'object' => $current_object, 'reason' => $reason );
