summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-28 11:43:50 +0200
committerAzul <azul@leap.se>2014-05-28 11:43:50 +0200
commit5c8ab9298cc4705de508a3f3f9d9d6370a01ff5e (patch)
tree8e25c1a4aa1450870e834b78d032c4a732b666a3
parent154d32bbc7cfe21d83141ff2c9a3d805165231b8 (diff)
minor: beautify handle lookup in etc/passwd some
-rw-r--r--app/models/local_email.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/models/local_email.rb b/app/models/local_email.rb
index 2b4c65e..ded7baf 100644
--- a/app/models/local_email.rb
+++ b/app/models/local_email.rb
@@ -58,11 +58,9 @@ class LocalEmail < Email
end
def handle_in_passwd?
- begin
- !!Etc.getpwnam(handle)
- rescue ArgumentError
- # handle was not found
- return false
- end
+ Etc.getpwnam(handle).present?
+ rescue ArgumentError
+ # handle was not found
+ return false
end
end