Eventplanning: New "needsAction" state

This commit is contained in:
Martin Bauer
2014-06-22 10:33:39 +02:00
parent 290db91956
commit df22b838fa
4 changed files with 42 additions and 13 deletions

View File

@@ -59,13 +59,15 @@ def buildGCalAttendeesObj( event ):
for userMapping in UserGCalCoupling.objects.all():
u = userMapping.user
participation = EventParticipation.get_or_create( u, event )
status = "tentative"
status = "needsAction"
if participation.status == "?" : status = "tentative"
if participation.status == 'Yes': status = "accepted"
if participation.status == 'No' : status = "declined"
o = {
'id': userMapping.email,
'email': u.email,
'email': userMapping.email,
'displayName': u.username,
'comment': participation.comment,
'responseStatus': status,
@@ -253,12 +255,14 @@ def syncFromGoogleToLocal( service = None ):
localId = e['extendedProperties']['private']['blechreizID']
localEvent = Event.objects.get( pk=localId )
for a in e['attendees']:
user = User.objects.get( email= a['email'] )
user = UserGCalCoupling.objects.get( email = a['email'] ).user
part = EventParticipation.get_or_create( user, localEvent )
if 'comment' in a:
part.comment = a['comment']
if a['responseStatus'] == 'needsAction' or a['responseStatus']=='tentative':
if a['responseStatus'] == 'needsAction' :
part.status = "-"
elif a['responseStatus']=='tentative':
part.status = '?'
elif a['responseStatus'] == 'accepted':
part.status = 'Yes'