ssafronova (ssafronova) wrote in changelog,
ssafronova
ssafronova
changelog

[livejournal] r16082: LJSV-857: Cannot suspend purged journals...

Committer: ssafronova
LJSV-857: Cannot suspend purged journals
U   trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm
U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm
===================================================================
--- trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm	2009-12-29 05:42:14 UTC (rev 16081)
+++ trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm	2010-01-12 08:27:10 UTC (rev 16082)
@@ -97,7 +97,12 @@
 
         ## Restore previous statusvis of journal. It may be different
         ## from 'V', it may be read-only, or locked, or whatever.
-        my @previous_status = grep { $_ ne 'S' } $u->get_previous_statusvis;
+        my @previous_status;
+        if ($u->clusterid) { # purged user has no cluster, but can be suspended
+            @previous_status = grep { $_ ne 'S' } $u->get_previous_statusvis;
+        } else { # was purged - no data any more
+            @previous_status = ('X');
+        }
         my $new_status = $previous_status[0] || 'V';
         my $method = {
             V => 'set_visible',

Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2009-12-29 05:42:14 UTC (rev 16081)
+++ trunk/cgi-bin/LJ/User.pm	2010-01-12 08:27:10 UTC (rev 16082)
@@ -4027,7 +4027,7 @@
             # remote looked up by log_event
             old => $u->statusvis,
             new => $statusvis,
-        });
+        }) if $u->clusterid; # purged user can get suspended, but have no clusterid at that moment
 
     # do update
     my $ret = LJ::update_user($u, { statusvis => $statusvis,

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