comparison gpp/gcalendar/calendar.py @ 228:d77e0dc772ad

Implement #88; add option to create a new forum thread from a new calendar entry.
author Brian Neal <bgneal@gmail.com>
date Sun, 11 Jul 2010 21:03:41 +0000
parents 9c18250972d5
children 9a4bffdf37c3
comparison
equal deleted inserted replaced
227:423c39ee44e0 228:d77e0dc772ad
70 i = int(entry.batch_id.text) 70 i = int(entry.batch_id.text)
71 code = int(entry.batch_status.code) 71 code = int(entry.batch_status.code)
72 72
73 error = False 73 error = False
74 if qs[i].status == Event.NEW_APRV or qs[i].status == Event.EDIT_APRV: 74 if qs[i].status == Event.NEW_APRV or qs[i].status == Event.EDIT_APRV:
75 if (code == 201 and qs[i].status == Event.NEW_APRV) or \ 75 if (code == 201 and qs[i].status == Event.NEW_APRV) or (
76 (code == 200 and qs[i].status == Event.EDIT_APRV): 76 code == 200 and qs[i].status == Event.EDIT_APRV):
77 qs[i].google_id = entry.id.text 77 qs[i].google_id = entry.id.text
78 qs[i].google_url = entry.GetHtmlLink().href
78 qs[i].status = Event.ON_CAL 79 qs[i].status = Event.ON_CAL
79 qs[i].save() 80 qs[i].save()
81 if code == 201:
82 qs[i].notify_on_calendar()
80 else: 83 else:
81 error = True 84 error = True
82 elif qs[i].status == Event.DEL_APRV: 85 elif qs[i].status == Event.DEL_APRV:
83 if code == 200: 86 if code == 200:
84 qs[i].delete() 87 qs[i].delete()