avoid double entries in accessed table

This commit is contained in:
j 2017-03-03 18:40:52 +01:00
parent b92d54e68d
commit 4f14b923fa

View file

@ -794,6 +794,7 @@ def setUI(request, data):
if data.get('item'):
item = get_object_or_404_json(Item, public_id=data['item'])
with transaction.atomic():
if request.user.is_authenticated():
access, created = Access.objects.get_or_create(item=item, user=request.user)
else: