Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Specify a secondary calendar to receive invites #15

Open
dhermes opened this issue Aug 26, 2014 · 1 comment
Open

Feature request: Specify a secondary calendar to receive invites #15

dhermes opened this issue Aug 26, 2014 · 1 comment

Comments

@dhermes
Copy link
Owner

dhermes commented Aug 26, 2014

When specifying a new ICS endpoint, also enable the user to specify a specific calendar for the invite to be created within.

Background: I use a separate calendar for Tripit and color code it so that travel info stands out. Without Having this feature the travel events are created along with everything else in the primary calendar, making it harder to see them.

NOTE: Migrated from Google Code Hosting

@dhermes
Copy link
Owner Author

dhermes commented Aug 26, 2014

I was able to successfully add an "alternate" calendar by doing the following:

from google.appengine.api import users
from models import UserCal
from google_api_utils import InitCredentials
from library import UpdateUserSubscriptions
from google.appengine.ext import ndb

fake_user_id = 'EMAIL.com_ABCD12345'
fake_email = fake_user_id + '@group.calendar.google.com'
fake_user = users.User(email=fake_email, _user_id=fake_user_id)
link = ('webcal://www.tripit.com/feed/ical/private/XYZ/tripit.ics')
user_cal = UserCal(key=ndb.Key(UserCal, fake_user_id),
                   owner=fake_user,
                   calendars=[link])
user_cal.put()
CREDENTIALS = InitCredentials()
UpdateUserSubscriptions(user_cal, credentials=CREDENTIALS, defer_now=True)

Before allowing users to do this I would need to get an OAuth 2.0 token for the user for the calendar scope and then verify that they had access to the calendar they were requesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant