Of course you can buy an ar-15 in California.
It just has to look retarded:
Note, there is nothing at all stopping a person intent on mass murder from merely swapping a few parts on their stupid looking ar-15 with a magazine lock and making one that looks like it should, and fully functional with a detachable magazine. Anyone with a brain could do it.
The law accomplishes literally nothing except to harrass the law-abiding it is so easy to bypass.