def update_badges(overwrite=False):
    from django.utils.importlib import import_module

    for app in settings.INSTALLED_APPS:
        mod = import_module(app)
        try:
            badges_mod = import_module('%s.badges' % app)
            fixture_label = '%s_badges' % app.replace('.','_')
            call_command('loaddata', fixture_label, verbosity=1)
            if hasattr(badges_mod, 'badges'):
                badger.utils.update_badges(badges_mod.badges, overwrite)
            if hasattr(badges_mod, 'update_badges'):
                badges_mod.update_badges(overwrite)
        except __HOLE__:
            if module_has_submodule(mod, 'badges'):
                raise
dataset/ETHPy150Open mozilla/django-badger/badger/management/__init__.py/update_badges