Skip to content

Commit

Permalink
Remove RecordNotificationRoutes when deleting shares
Browse files Browse the repository at this point in the history
- fixes chb#38
  • Loading branch information
Travers Franckle committed Oct 5, 2012
1 parent 37af68f commit b36961b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion indivo/views/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,13 @@ def record_share_delete(request, record, other_account_id):
"""

try:
shares = AccountFullShare.objects.filter(record = record, with_account = Account.objects.get(email=other_account_id.lower().strip()))
account = Account.objects.get(email=other_account_id.lower().strip())
shares = AccountFullShare.objects.filter(record = record, with_account = account)
shares.delete()
# delete the message route
routes = RecordNotificationRoute.objects.filter(record = record, account = account)
routes.delete()
return DONE
return DONE
except Account.DoesNotExist:
raise Http404
Expand Down

0 comments on commit b36961b

Please sign in to comment.