Committer: nnikulochkina
LJSUP-13376: Show inactive rows in "reserved" tabU trunk/bin/upgrading/en_LJ.dat U trunk/cgi-bin/LJ/Hooks/SUP.pm U trunk/cgi-bin/LJ/Pay/Wallet/Error.pm
Modified: trunk/bin/upgrading/en_LJ.dat =================================================================== --- trunk/bin/upgrading/en_LJ.dat 2012-08-23 08:12:06 UTC (rev 12525) +++ trunk/bin/upgrading/en_LJ.dat 2012-08-23 09:52:57 UTC (rev 12526) @@ -16563,6 +16563,8 @@ wallet.bml.reserved.total|staleness=1 wallet.bml.reserved.total=Total +wallet.error_acc_active=Cannot delete active account + wallet.error_acc_inactive=Account already inactive wallet.error_acc_insufficient_blocked|staleness=1 Modified: trunk/cgi-bin/LJ/Hooks/SUP.pm =================================================================== --- trunk/cgi-bin/LJ/Hooks/SUP.pm 2012-08-23 08:12:06 UTC (rev 12525) +++ trunk/cgi-bin/LJ/Hooks/SUP.pm 2012-08-23 09:52:57 UTC (rev 12526) @@ -1014,10 +1014,15 @@ LJ::WishList->clean_post_id($ju, $entry->ditemid); - # If repost offer exists, revoke it + # If repost offer exists, delete it if($entry->repost_offer) { my $repost_offer = LJ::Pay::Repost::Offer->load($jid, $entry->repost_offer); - $repost_offer->revoke if $repost_offer->is_active; + my $err; + if ($repost_offer->inactive || $repost_offer->revoke(\$err,{pay_blockings => 1})) { + $repost_offer->delete; + } else { + die "Cannot delete repost offer: $err"; + } } }); Modified: trunk/cgi-bin/LJ/Pay/Wallet/Error.pm =================================================================== --- trunk/cgi-bin/LJ/Pay/Wallet/Error.pm 2012-08-23 08:12:06 UTC (rev 12525) +++ trunk/cgi-bin/LJ/Pay/Wallet/Error.pm 2012-08-23 09:52:57 UTC (rev 12526) @@ -65,6 +65,7 @@ ERROR_BLOCKED_EXISTS => 102, ERROR_ACC_INSUFFICIENT_BLOCKED => 103, ERROR_ACC_INACTIVE => 104, + ERROR_ACC_ACTIVE => 105, # Blocking errors, 200 <= code < 300 ERROR_INVALID_BLOCKING => 200,