Rewrite conditional block so that it works with django inheritance order. MJ-543