Sayyiduna Hakim bin Hizam (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) forbade that retaliation be taken in the mosques, that poetry be recited in them, or that the prescribed punishments be carried out in them.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20267