wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r12481: LJSUP-13266: Add limit for sending free ...

Committer: wisest-owl
LJSUP-13266: Add limit for sending free user heads

U   trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm	2012-08-16 11:54:40 UTC (rev 12480)
+++ trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm	2012-08-16 12:42:47 UTC (rev 12481)
@@ -558,7 +558,7 @@
     $months     = $qty if $qty < 100;
     $exact_time = $qty if $qty >= $now;
 
-    if ($self->isa('LJ::Pay::Payment::PayItem::UserHead')) {
+    if (ref $self eq 'LJ::Pay::Payment::PayItem::UserHead') {
         ##
         ## We store the number of purchased special userheads in user property 'userheads_restrict'
         ## format is "uh_id:number_of_userheads,uh_id2:number_of_userheads2"
@@ -566,7 +566,8 @@
         my $subitem = $self->{subitem};
         my ($uh_id) = $subitem =~ m#uh-(\d+)#;
         my $uh = LJ::UserHead->get_userhead ($uh_id);
-        my $buyer_u = LJ::load_user ($self->{'userid'});
+        my $cart = LJ::Pay::Payment->load (payid => $self->{'payid'});
+        my $buyer_u = LJ::load_userid ($cart->{'userid'});
         if ($uh->get_buy_limit > 0) {
             if ($buyer_u) {
                 my $uhs_restrict = $buyer_u->prop('userheads_restrict');

Tags: ljcom, pm, wisest-owl
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