Fix deprecation error for Django 1.8

Switch order of checking for model_name vs module_name to stop deprecation warning