From a6399c1305804a7fbc8c92c698f0562f1d54cc68 Mon Sep 17 00:00:00 2001 From: Trever Fischer Date: Fri, 2 Mar 2012 20:41:51 -0500 Subject: [PATCH] Handle duplicate minecraft registrations --- api/handlers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/handlers.py b/api/handlers.py index b37c231..e74218a 100644 --- a/api/handlers.py +++ b/api/handlers.py @@ -9,8 +9,8 @@ class WhitelistHandler(AnonymousBaseHandler): def read(self, request, username=None): if username: try: - profile = MinecraftProfile.objects.get(mc_username__iexact=username) - except Exception, e: + profile = MinecraftProfile.objects.all().filter(mc_username__iexact=username)[0] + except IndexError, e: return HttpResponse(status=403) if profile.user.is_active: return HttpResponse(status=204)