Tidge of refactoring.

        Patch by afuna. 

diffs (30 lines):

diff -r 46269e8ab69a -r 72ce895d6740 cgi-bin/LJ/Widget/CreateAccount.pm
--- a/cgi-bin/LJ/Widget/CreateAccount.pm        Sat Jun 06 04:01:55 2009 +0000
+++ b/cgi-bin/LJ/Widget/CreateAccount.pm        Sat Jun 06 04:05:38 2009 +0000
@@ -308,18 +308,15 @@ sub render_body {
     }
 
     if ( $LJ::USE_ACCT_CODES ) {
-        my $itemidref;
-        if ( my $cart = DW::Shop::Cart->get_from_invite( $code, itemidref => 
\$itemidref ) ) {
-            my $item = $cart->get_item( $itemidref );
-            if ( $item && $item->isa( 'DW::Shop::Item::Account' ) ) {
-                $ret .= "<tr valign='top'><td 
class='field-name'>&nbsp;</td>\n<td>";
-                if ( $item->permanent ) {
-                    $ret .= $class->ml( 
'widget.createaccount.field.paidaccount.permanent', { type => "<strong>" . 
$item->class_name . "</strong>" } );
-                } else {
-                    $ret .= $class->ml( 
'widget.createaccount.field.paidaccount', { type => "<strong>" . 
$item->class_name . "</strong>", nummonths => $item->months } );
-                }
-                $ret .= "</td></tr>";
+        my $item = DW::InviteCodes->paid_status( code => $code );
+        if ( $item ) {
+            $ret .= "<tr valign='top'><td 
class='field-name'>&nbsp;</td>\n<td>";
+            if ( $item->permanent ) {
+                $ret .= $class->ml( 
'widget.createaccount.field.paidaccount.permanent', { type => "<strong>" . 
$item->class_name . "</strong>" } );
+            } else {
+                $ret .= $class->ml( 'widget.createaccount.field.paidaccount', 
{ type => "<strong>" . $item->class_name . "</strong>", nummonths => 
$item->months } );
             }
+            $ret .= "</td></tr>";
         }
     }
 
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to