Skip to content

Commit

Permalink
sync and pre
Browse files Browse the repository at this point in the history
  • Loading branch information
krrish-sehgal committed Jan 26, 2025
1 parent 02cd16d commit f64465a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 17 deletions.
4 changes: 1 addition & 3 deletions website/challenge_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
from .models import Challenge, IpReport, Issue, Points, TimeLog, UserProfile


def update_challenge_progress(
user, challenge_title, model_class, reason, threshold=None, team_threshold=None
):
def update_challenge_progress(user, challenge_title, model_class, reason, threshold=None, team_threshold=None):
if not user.is_authenticated:
return
try:
Expand Down
4 changes: 1 addition & 3 deletions website/migrations/0173_challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ class Migration(migrations.Migration):
),
(
"team_participants",
models.ManyToManyField(
blank=True, related_name="team_challenges", to="website.organization"
),
models.ManyToManyField(blank=True, related_name="team_challenges", to="website.organization"),
),
],
),
Expand Down
4 changes: 1 addition & 3 deletions website/migrations/0177_alter_challenge_team_participants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="challenge",
name="team_participants",
field=models.ManyToManyField(
blank=True, related_name="team_challenges", to="website.organization"
),
field=models.ManyToManyField(blank=True, related_name="team_challenges", to="website.organization"),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("website", "0178_merge_20241229_1948"),
("website", "0179_contributorstats"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Generated by Django 5.1.4 on 2025-01-26 10:10

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("website", "0183_merge_20250124_0618"),
("website", "0183_slackbotactivity"),
]

operations = []
2 changes: 1 addition & 1 deletion website/views/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -1626,4 +1626,4 @@ def delete_manager(request, manager_id, domain_id):
except Domain.DoesNotExist:
return JsonResponse({"success": False, "message": "Domain not found."})
except User.DoesNotExist:
return JsonResponse({"success": False, "message": "User not found."})
return JsonResponse({"success": False, "message": "User not found."})
2 changes: 1 addition & 1 deletion website/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,4 +923,4 @@ def handler404(request, exception):


def handler500(request, exception=None):
return render(request, "500.html", {}, status=500)
return render(request, "500.html", {}, status=500)
2 changes: 1 addition & 1 deletion website/views/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -1581,4 +1581,4 @@ def flag_issue(request, issue_pk):


def select_bid(request):
return render(request, "bid_selection.html")
return render(request, "bid_selection.html")
2 changes: 1 addition & 1 deletion website/views/slackbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,4 @@ def slack_commands(request):
if request.content_type != "application/x-www-form-urlencoded":
return JsonResponse({"error": "Invalid content type"}, status=415)
return HttpResponse(handler.handle(request))
return JsonResponse({"error": "Method not allowed"}, status=405)
return JsonResponse({"error": "Method not allowed"}, status=405)
4 changes: 1 addition & 3 deletions website/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,9 +1003,7 @@ class UserChallengeListView(View):

def get(self, request):
challenges = Challenge.objects.filter(challenge_type="single") # All single-user challenges
user_challenges = challenges.filter(
participants=request.user
) # Challenges the user is participating in
user_challenges = challenges.filter(participants=request.user) # Challenges the user is participating in

for challenge in challenges:
if challenge in user_challenges:
Expand Down

0 comments on commit f64465a

Please sign in to comment.