Files
@ 5abf9ad3ab75
Branch filter:
Location: symposion_app/pinaxcon/monkey_patch.py - annotation
5abf9ad3ab75
755 B
text/x-python
Merge pull request #34 from faulteh/master
Added analytics script
Added analytics script
2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 2cdb554623e5 | class MonkeyPatchMiddleware(object):
''' Ensures that our monkey patching only gets called after it is safe to do so.'''
def process_request(self, request):
do_monkey_patch()
def do_monkey_patch():
patch_speaker_profile_form()
# Remove this function from existence
global do_monkey_patch
do_monkey_patch = lambda: None
def patch_speaker_profile_form():
''' Replaces textarea widgets with markdown editors. '''
import widgets
from symposion.speakers.forms import SpeakerForm
fields = SpeakerForm.base_fields
fields["biography"].widget = widgets.AceMarkdownEditor()
fields["experience"].widget = widgets.AceMarkdownEditor()
fields["accessibility"].widget = widgets.AceMarkdownEditor()
|