# HG changeset patch # User Brian Neal # Date 1245468234 0 # Node ID 0140ff687d49d2a8efaccd04147bdad8145ec216 # Parent a5b4c5ce0658889c2a81207a39c2df80246b7223 Membermap bug: in the signal handler, if the user isn't on the map, just bail out. diff -r a5b4c5ce0658 -r 0140ff687d49 gpp/membermap/signals.py --- a/gpp/membermap/signals.py Fri Jun 19 03:16:03 2009 +0000 +++ b/gpp/membermap/signals.py Sat Jun 20 03:23:54 2009 +0000 @@ -11,11 +11,13 @@ def on_profile_save(sender, **kwargs): if 'instance' in kwargs: profile = kwargs['instance'] - map_entry = MapEntry.objects.get(user=profile.user) + try: + map_entry = MapEntry.objects.get(user=profile.user) + except MapEntry.DoesNotExist: + # Not on the map, no harm, no foul + return if map_entry is not None: map_entry.save() post_save.connect(on_profile_save, sender=UserProfile) - -# vim: ts=4 sw=4