This check would be better using `modulestore.get_modulestore_type`, I think. Since you have a course in hand, you check if that particular course is hosted in mongo or in xml.