1. Jannis Leidel
  2. django_openid_provider

Commits

romke  committed 481f8ea

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

  • Participants
  • Parent commits 3484465
  • Branches default

Comments (0)

Files changed (1)

File openid_provider/views.py

View file
  • Ignore whitespace
         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