Skip to content

Commit

Permalink
Move some monkeypatching from manage.py to monkeypatch.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rlr committed Jan 3, 2013
1 parent e57809c commit 5f85068
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 10 additions & 0 deletions apps/sumo/monkeypatch.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -72,3 +72,13 @@ def _collect(self, objs, source_attr=None, **kwargs):
self.protected.update(e.protected_objects) self.protected.update(e.protected_objects)


util.NestedObjects.collect = _collect util.NestedObjects.collect = _collect


# Monkey patch for Bug 663236: Make |safe less necessary for form fields
from lib import safe_django_forms
safe_django_forms.monkeypatch()


# Monkey patch django's csrf
import session_csrf
session_csrf.monkeypatch()
7 changes: 0 additions & 7 deletions manage.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
sys.path[:0] = new_sys_path sys.path[:0] = new_sys_path


# Now we can import from third-party libraries. # Now we can import from third-party libraries.
# Monkey patch for Bug 663236: Make |safe less necessary for form fields
from lib import safe_django_forms
safe_django_forms.monkeypatch()


from django.core.management import execute_manager, setup_environ from django.core.management import execute_manager, setup_environ


Expand All @@ -44,10 +41,6 @@
# needs to access settings, so we'll setup the environ early. # needs to access settings, so we'll setup the environ early.
setup_environ(settings) setup_environ(settings)


# Monkey patch django's csrf
import session_csrf
session_csrf.monkeypatch()

# Import for side-effect: configures our logging handlers. # Import for side-effect: configures our logging handlers.
import log_settings import log_settings


Expand Down

0 comments on commit 5f85068

Please sign in to comment.