[Rt-commit] r17357 - rt/3.8/trunk/lib/RT

clkao at bestpractical.com clkao at bestpractical.com
Thu Dec 25 08:58:12 EST 2008


Author: clkao
Date: Thu Dec 25 08:58:12 2008
New Revision: 17357

Modified:
   rt/3.8/trunk/lib/RT/Ticket_Overlay.pm

Log:
< obra> so, the way RT usually does similar things is "try to load by
        name. if that fails, load by email"


Modified: rt/3.8/trunk/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Ticket_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/Ticket_Overlay.pm	Thu Dec 25 08:58:12 2008
@@ -394,9 +394,9 @@
     #If we've been handed something else, try to load the user.
     elsif ( $args{'Owner'} ) {
         $Owner = RT::User->new( $self->CurrentUser );
-        $args{'Owner'} =~ /^\S+@\S+$/
-            ? $Owner->LoadByEmail($args{'Owner'})
-            : $Owner->Load( $args{'Owner'} );
+        $Owner->Load( $args{'Owner'} );
+        $Owner->LoadByEmail( $args{'Owner'} )
+            unless $Owner->Id;
         unless ( $Owner->Id ) {
             push @non_fatal_errors,
                 $self->loc("Owner could not be set.") . " "


More information about the Rt-commit mailing list