Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/d/j/django-lfs-HEAD/lfs/cart/utils.py   django-lfs(Download)
                    cart = Cart.objects.get(user=user)
                except Cart.MultipleObjectsReturned:
                    carts = Cart.objects.filter(user=user)
                    cart = carts[0]
                    carts.exclude(pk=cart.pk).delete()
                    cart = Cart.objects.get(session=session_key)
                except Cart.MultipleObjectsReturned:
                    carts = Cart.objects.filter(session=session_key)
                    cart = carts[0]
                    carts.exclude(pk=cart.pk).delete()

src/d/j/django-lfs-HEAD/lfs/cart/management/commands/cleanup_carts.py   django-lfs(Download)
        today = datetime.date.today()
        dt = today - datetime.timedelta(days=days)
        qs = Cart.objects.filter(modification_date__lt=dt)
        carts_count = qs.count()
        qs.delete()