Skip to content

Commit

Permalink
final fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
krrish-sehgal committed Dec 19, 2024
1 parent 4323018 commit 6d58c20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions website/challenge_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def handle_post_save(sender, instance, created, **kwargs):
reason="Completed 'Report 5 IPs' challenge",
threshold=5,
)
if instance.user.userprofile.team:
if instance.user.is_authenticated and instance.user.userprofile.team:
update_challenge_progress(
user=instance.user,
challenge_title="Report 10 IPs",
Expand All @@ -92,7 +92,7 @@ def handle_post_save(sender, instance, created, **kwargs):
reason="Completed 'Report 5 Issues challenge",
threshold=5,
)
if instance.user.userprofile.team:
if instance.user.is_authenticated and instance.user.userprofile.team:
update_challenge_progress(
user=instance.user,
challenge_title="Report 10 Issues",
Expand Down
2 changes: 1 addition & 1 deletion website/feed_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def update_user_streak(sender, instance, created, **kwargs):
"""
Automatically update user's streak when a TimeLog is created
"""
if created:
if created and instance.user and instance.user.is_authenticated:
check_in_date = instance.start_time.date()
try:
user_profile = instance.user.userprofile
Expand Down

0 comments on commit 6d58c20

Please sign in to comment.