• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

djbrown / hbscorez / 18477252551

13 Oct 2025 08:18PM UTC coverage: 46.38% (-0.09%) from 46.467%
18477252551

Pull #165

github

djbrown
harmonize pr-build to ci-build
Pull Request #165: Move from Handball4All to handball.net

49 of 223 branches covered (21.97%)

Branch coverage included in aggregate %.

21 of 58 new or added lines in 21 files covered. (36.21%)

2 existing lines in 2 files now uncovered.

1687 of 3520 relevant lines covered (47.93%)

0.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

23.08
/src/api/views.py
1
from django.http import JsonResponse
1✔
2

3
from associations.models import Association
1✔
4
from districts.models import District
1✔
5
from leagues.models import League, Season
1✔
6

7

8
def associations(_):
1✔
9
    light_associations = [
×
10
        {
11
            "name": a.name,
12
            "shortName": a.short_name,
13
        }
14
        for a in Association.objects.all()
15
    ]
16

17
    return JsonResponse({"associations": light_associations})
×
18

19

20
def association_districts(_, short_name):
1✔
NEW
21
    association_results = Association.objects.filter(short_name=short_name)
×
22

23
    if not association_results.exists():
×
24
        return JsonResponse({"error": "No matching Association found."}, status=404)
×
25

26
    association = association_results[0]
×
27

28
    districts = [
×
29
        {
30
            "bhvId": district.bhv_id,
31
            "name": district.name,
32
        }
33
        for district in association.district_set.all()
34
    ]
35

36
    return JsonResponse({"districts": districts})
×
37

38

39
def seasons(_):
1✔
40
    light_seasons = [{"startYear": season.start_year} for season in Season.objects.all()]
×
41

42
    return JsonResponse({"seasons": light_seasons})
×
43

44

45
def district_season_leagues(_, bhv_id, start_year):
1✔
46
    district_results = District.objects.filter(bhv_id=bhv_id)
×
47
    if not district_results.exists():
×
48
        return JsonResponse({"error": "No matching District found."}, status=404)
×
49
    district = district_results[0]
×
50

51
    season_results = Season.objects.filter(start_year=start_year)
×
52
    if not season_results.exists():
×
53
        return JsonResponse({"error": "No matching Season found."}, status=404)
×
54
    season = season_results[0]
×
55

56
    light_leagues = [
×
57
        {
58
            "bhvId": league.bhv_id,
59
            "name": league.name,
60
        }
61
        for league in League.objects.filter(district=district, season=season)
62
    ]
63

64
    return JsonResponse({"leagues": light_leagues})
×
65

66

67
def league_teams(_, bhv_id):
1✔
68
    leagues = League.objects.filter(bhv_id=bhv_id)
×
69

70
    if not leagues.exists():
×
71
        return JsonResponse({"error": "No matching League found."}, status=404)
×
72

73
    league = leagues[0]
×
74

75
    light_teams = [
×
76
        {
77
            "bhvId": team.bhv_id,
78
            "name": team.name,
79
            "shortName": team.short_name,
80
        }
81
        for team in league.team_set.all()
82
    ]
83

84
    return JsonResponse({"teams": light_teams})
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc