Eventplanning: New "needsAction" state
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user