This seems like a pretty reasonable use for a CoC in my view--flirting isn't ubiquitously taboo (unlike racism, trolling, or overt sexual harassment) nor should it be, but it's understandable that a community would prefer to just prohibit it outright and set that expectation clearly up front.
CoCs should focus narrowly on this kind of thing (of course, without giving the impression that these are the only offenses that a person might be kicked out for), and proponents of CoCs should talk about this. Instead, much of this thread is talking about racist trolling, as though CoCs are necessary or sufficient for dissuading a racist troll (everyone understands racism is unacceptable; if you're motivated to cross that line anyway, a CoC isn't going to deter you).
This sounds terrible and I guess I'll have to modify our CoC to deal with it when it occurs.
OTOH, we've had frequent cases of sexual harassment (primarily men hitting on women at events) and a CoC has been extremely useful in dealing with those situations.