Skip to content

Commit 2e1ce3e

Browse files
committed
apply suggestions
1 parent 6b5bac5 commit 2e1ce3e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

home/views.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,13 +480,16 @@ def profile(request):
480480
if request.method == "POST" and request.user.is_authenticated:
481481
if student:
482482
try:
483-
print(request.FILES)
483+
logger.debug(request.FILES)
484484
file = request.FILES["profile-picture"]
485485
student.photo = file
486486
student.save()
487487
except Exception as e:
488488
logger.error(e)
489-
return redirect(request.path)
489+
if url_has_allowed_host_and_scheme(request.path, allowed_hosts=None):
490+
return redirect(request.path)
491+
else:
492+
return redirect("/")
490493
text = ""
491494
socialaccount_obj = SocialAccount.objects.filter(
492495
provider="google", user_id=request.user.id

0 commit comments

Comments
 (0)