Skip to content

Commit ec85860

Browse files
authored
Merge branch 'main' into dependabot/pip/demo/graph_tutorial/cryptography-37.0.4
2 parents 06f8678 + 573cc1e commit ec85860

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

graph_tutorial/tutorial/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ def sign_out(request):
5858
def calendar(request):
5959
context = initialize_context(request)
6060
user = context['user']
61+
if not user['is_authenticated']:
62+
return HttpResponseRedirect(reverse('signin'))
6163

6264
# Load the user's time zone
6365
# Microsoft Graph can return the user's time zone as either
@@ -103,6 +105,8 @@ def calendar(request):
103105
def new_event(request):
104106
context = initialize_context(request)
105107
user = context['user']
108+
if not user['is_authenticated']:
109+
return HttpResponseRedirect(reverse('signin'))
106110

107111
if request.method == 'POST':
108112
# Validate the form values

0 commit comments

Comments
 (0)