diff --git a/lib/Pear/LocalLoop/Schema/Result/User.pm b/lib/Pear/LocalLoop/Schema/Result/User.pm index 151075d..75a1dde 100644 --- a/lib/Pear/LocalLoop/Schema/Result/User.pm +++ b/lib/Pear/LocalLoop/Schema/Result/User.pm @@ -149,8 +149,17 @@ sub name { } elsif ( defined $self->organisation_id ) { return $self->organisation->name; } else { - return undef; + return; } } +sub type { + my $self = shift; + + if ( defined $self->customer_id ) { + return "customer"; + } + return "organisation"; +} + 1;