Skip to content

Commit

Permalink
commit - prior to filtering branch
Browse files Browse the repository at this point in the history
  • Loading branch information
scottharman committed Feb 8, 2016
1 parent 7bd6ec6 commit 7cd3b62
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
4 changes: 4 additions & 0 deletions ConferenceCentral_Complete/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ handlers: # static then dynamic
- url: /tasks/send_session_email
script: main.app

- url: /tasks/set_featuredspeaker
script: main.app


- url: /crons/set_announcement
script: main.app

Expand Down
20 changes: 10 additions & 10 deletions ConferenceCentral_Complete/conference.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def _createSessionObject(self, request):
)

# Add featured speaker - generate code and add here.
if Sessions.query(Session.speakerUserId == \
if Session.query(Session.speakerUserId == \
data['speakerUserId']).count() > 1:
taskqueue.add(params={'speakerUserId': data['speakerUserId']},
url='/tasks/set_featuredspeaker')
Expand Down Expand Up @@ -525,22 +525,22 @@ def _copySessionWishlisttoForm(self, wishlist):
swl.check_initialized()
return swl

@endpoints.method(WISHLIST_REQUEST, WishlistForm,
path='wishlist',
@endpoints.method(WISHLIST_REQUEST, SessionWishlistForms,
path='wishlist/add',
http_method='POST',
name='addSessionToWishlist')
def addSessionToWishlist(self, request):
return

@endpoints.method(WISHLIST_REQUEST, SessionForms,
path='wishlist',
path='sessions/wishlist',
http_method='GET',
name='getSessionsInWishlist')
def getSessionsInWishlist(self, request):
return

@endpoints.method(WISHLIST_REQUEST, SessionForms,
path='wishlist',
@endpoints.method(WISHLIST_REQUEST, SessionWishlistForms,
path='wishlist/delete',
http_method='GET',
name='deleteSessionInWishlist')
def deleteSessionInWishlist(self, request):
Expand Down Expand Up @@ -659,14 +659,14 @@ def _cacheFeaturedSpeaker(speakerUserId):
"""Create Speaker Announcement & assign to memcache
"""
speaker = speakerUserId
announce_speaker = SPEAKER_TPL % (speaker)
memcache.set(MEMCACHE_SPEAKER_KEY, announce_speaker)
# announce_speaker = SPEAKER_TPL % (speaker)
memcache.set(MEMCACHE_SPEAKER_KEY, speaker)

return speaker

@endpoints.method(message_types.VoidMessage, StringMessage,
path='conference/announcement/get',
http_method='GET', name='getAnnouncement')
path='session/featured/get',
http_method='GET', name='getFeaturedSpeaker')
def getFeaturedSpeaker(self, request):
"""Return Speaker from memcache."""
return StringMessage(data=memcache.get(MEMCACHE_SPEAKER_KEY) or "")
Expand Down
7 changes: 4 additions & 3 deletions ConferenceCentral_Complete/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@ def post(self):
)

class SetSpeakerHandler(webapp2.RequestHandler):
def get(self):
"""Set Speaker Announcement in Memcache."""
def post(self):
"""Set Speaker Announcement in Memcache.
Switch from get to post when copying the announcment handler"""
speakerUserId = self.request.get('speakerUserId')
ConferenceApi._cacheFeaturedSpeaker(speakerUserId)
self.response.set_status(204)


app = webapp2.WSGIApplication([
('/crons/set_announcement', SetAnnouncementHandler),
('/crons/set_featuredspeaker', SetSpeakerHandler),
('/tasks/set_featuredspeaker', SetSpeakerHandler),
('/tasks/send_confirmation_email', SendConfirmationEmailHandler),
('/tasks/send_session_email', SendSessionEmailHandler),
], debug=True)

0 comments on commit 7cd3b62

Please sign in to comment.