Skip to content

Commit

Permalink
Temporarily hack fix #386
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeacom committed Feb 10, 2018
1 parent 26f5d13 commit ccf4f40
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ def profile_helper(handle):
profile = Profile.objects.get(handle__iexact=handle)
except Profile.DoesNotExist:
raise Http404
except Profile.MultipleObjectsReturned as e:
# Handle edge case where multiple Profile objects exist for the same handle.
# We should consider setting Profile.handle to unique.
# TODO: Should we handle merging or removing duplicate profiles?
profile = Profile.objects.filter(handle__iexact=handle).latest('id')
logging.error(e)
return profile


Expand Down

0 comments on commit ccf4f40

Please sign in to comment.