Commits

romke  committed 481f8ea

fixed possibility of exception when auto-selecting openid for user that has none

  • Participants
  • Parent commits 3484465

Comments (0)

Files changed (1)

File openid_provider/views.py

         openids = request.user.openid_set.filter(default=True)
         if openids.count() == 1:
             return openids[0]
-        return request.user.openid_set.all()[0]
+        if request.user.openid_set.count() > 0:
+            return request.user.openid_set.all()[0]
     return None