(request, device)
return HttpResponseRedirect(reverse("devices"))
Mars a client as deleted, but does not permanently delete it
Mars a client as deleted, but does not permanently delete it
Mars a client as deleted but does not permanently delete it
def delete(request, device):
    """Mars a client as deleted, but does not permanently delete it"""

    # remoe the device from the sync group
    device.stop_sync()

    # mark the subscriptions as deleted
    Subscription.objects.filter(user=request.user, client=device).update(deleted=True)

    # mark the client as deleted
    device.deleted = True
    device.save()

    return HttpResponseRedirect(reverse("devices"))
def delete ( request , device ) : # remoe the device from the sync group device . stop_sync ( ) # mark the subscriptions as deleted Subscription . objects . filter ( user = request . user , client = device ) . update ( deleted = True ) # mark the client as deleted device . deleted = True device . save ( ) return HttpResponseRedirect ( reverse ( "devices" ) )