Changeset - ddfa3a4fbdf8
[Not reviewed]
0 1 0
Christopher Neugebauer - 4 years ago 2017-11-18 00:26:41
chrisjrn@gmail.com
fixes an oops
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
pinaxcon/monkey_patch.py
Show inline comments
...
 
@@ -32,49 +32,49 @@ def patch_stripe_card_defaults():
 
        d.update(source)
 
        return old_sync_card(customer, d)
 

	
 
    sources.sync_card = sync_card
 

	
 

	
 
def patch_conference_schedule():
 
    from symposion.schedule import views as sv
 
    from symposion.schedule import models as sm
 

	
 
    old_schedule_json = sv._schedule_json
 

	
 
    @wraps(old_schedule_json)
 
    def schedule_json(request):
 
        schedule = old_schedule_json(request)
 

	
 
        for slot_data in schedule:
 
            slot = sm.Slot.objects.get(id=slot_data["conf_key"])
 
            presentation = slot.content
 
            if presentation is not None:
 
                update_presentation(request, slot_data, presentation)
 
            elif slot.kind.label.lower() == "keynote":
 
                update_keynote(request, slot_data)
 
            elif slot.kind.label.lower() == "housekeeping":
 
                update_keynote(request, slot_data)
 
                update_housekeeping(request, slot_data)
 
            else:
 
                pass
 

	
 
        return schedule
 

	
 
    def update_presentation(request, slot_data, presentation):
 
        try:
 
            slot_data["reviewers"] = (
 
                presentation.speaker.conferencespeaker.reviewer
 
                if request.user.is_staff else ["redacted"]
 
            )
 
            slot_data["license"] = "CC BY-SA"
 
            slot_data["released"] = presentation.proposal_base.talkproposal.recording_release
 
            slot_data["twitter_id"] = presentation.speaker.conferencespeaker.twitter_username
 
        except Exception as e:
 
            print e
 

	
 
    def update_keynote(request, slot_data):
 
        keynotes = {
 
            "Brandon Rhodes": (User.objects.get(username="brandon").email, "brandon_rhodes"),
 
            "Carina C. Zona": (User.objects.get(username="cczona").email, "cczona"),
 
        }
 
        for speaker, values in keynotes.items():
 
            print speaker
0 comments (0 inline, 0 general)