Ticket #12012: 12012-r11624.diff
File 12012-r11624.diff, 1.9 KB (added by , 15 years ago) |
---|
-
django/db/models/loading.py
52 52 try: 53 53 if self.loaded: 54 54 return 55 56 if hasattr(settings, 'PRE_MODEL_CALLBACKS'): 57 callbacks = settings.PRE_MODEL_CALLBACKS 58 for callback in callbacks: 59 callback() 60 55 61 for app_name in settings.INSTALLED_APPS: 56 62 if app_name in self.handled: 57 63 continue … … 60 66 for app_name in self.postponed: 61 67 self.load_app(app_name) 62 68 self.loaded = True 69 70 if hasattr(settings, 'POST_MODEL_CALLBACKS'): 71 callbacks = settings.POST_MODEL_CALLBACKS 72 for callback in callbacks: 73 callback() 74 63 75 finally: 64 76 self.write_lock.release() 65 77 -
django/conf/__init__.py
85 85 setting_value = (setting_value,) # In case the user forgot the comma. 86 86 setattr(self, setting, setting_value) 87 87 88 if hasattr(self, 'BOOTSTRAP_CALLBACKS'): 89 try: 90 callbacks = self.BOOTSTRAP_CALLBACKS 91 for callback in callbacks: 92 try: 93 callback() 94 except Exception: 95 raise # TODO handle error in callback 96 except TypeError: 97 raise # TODO handle non-iterable 98 88 99 # Expand entries in INSTALLED_APPS like "django.contrib.*" to a list 89 100 # of all those apps. 90 101 new_installed_apps = []