@login_required
def badges(request, code):
    (project, rw) = _get_project_for_user(request, code)
    tags = set()
    for check in Check.objects.filter(project=project):
        tags.update(check.tags_list())
    sorted_tags = sorted(tags, key=(lambda s: s.lower()))
    sorted_tags.append('*')
    key = project.badge_key
    urls = []
    for tag in sorted_tags:
        urls.append({'tag': tag, 'svg': get_badge_url(key, tag), 'svg3': get_badge_url(key, tag, with_late=True), 'json': get_badge_url(key, tag, fmt='json'), 'json3': get_badge_url(key, tag, fmt='json', with_late=True), 'shields': get_badge_url(key, tag, fmt='shields'), 'shields3': get_badge_url(key, tag, fmt='shields', with_late=True)})
    ctx = {'have_tags': (len(urls) > 1), 'page': 'badges', 'project': project, 'badges': urls}
    return render(request, 'front/badges.html', ctx)
@login_required
def badges(request, code):
    (project, rw) = _get_project_for_user(request, code)
    tags = set()
    for check in Check.objects.filter(project=project):
        tags.update(check.tags_list())
    sorted_tags = sorted(tags, key=(lambda s: s.lower()))
    sorted_tags.append('*')
    key = project.badge_key
    urls = []
    for tag in sorted_tags:
        urls.append({'tag': tag, 'svg': get_badge_url(key, tag), 'svg3': get_badge_url(key, tag, with_late=True), 'json': get_badge_url(key, tag, fmt='json'), 'json3': get_badge_url(key, tag, fmt='json', with_late=True), 'shields': get_badge_url(key, tag, fmt='shields'), 'shields3': get_badge_url(key, tag, fmt='shields', with_late=True)})
    ctx = {'have_tags': (len(urls) > 1), 'page': 'badges', 'project': project, 'badges': urls}
    return render(request, 'front/badges.html', ctx)