That is not really a common idiom in itself, but a metaphor on the meaning of se branler, which is a vulgar term for "to masturbate". It relates in the sense that masturbating is a pleasure one (usually…) "creates" on purpose and for oneself. In the context you mention, the mayor therefore compares self-congratulation of his supporters to masturbation.
You can understand it as "there is no reason to rejoice", "there is nothing to celebrate".
Leave a comment