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

uw-it-aca / myuw / 9232782437

25 May 2024 04:06AM UTC coverage: 91.866% (+0.05%) from 91.816%
9232782437

Pull #3109

github

fanglinfang
Add test cache_expiration of mailman
Pull Request #3109: Fix/muwm 5308

69 of 78 new or added lines in 9 files covered. (88.46%)

1 existing line in 1 file now uncovered.

17540 of 19093 relevant lines covered (91.87%)

9.38 hits per line

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

61.11
/myuw/views/photo.py
1
# Copyright 2024 UW-IT, University of Washington
2
# SPDX-License-Identifier: Apache-2.0
3

4
import logging
1✔
5
import traceback
1✔
6
from django.contrib.auth.decorators import login_required
1✔
7
from django.http import StreamingHttpResponse
1✔
8
from myuw.dao import id_photo_token
1✔
9
from myuw.dao.pws import get_idcard_photo
1✔
10
from myuw.logger.logresp import log_exception
1✔
11
from myuw.views.error import data_not_found
1✔
12

13
logger = logging.getLogger(__name__)
1✔
14

15

16
@login_required
1✔
17
def show_photo(request, uwregid, token):
1✔
NEW
18
    if id_photo_token.valid_token(token):
×
NEW
19
        try:
×
NEW
20
            photo = get_idcard_photo(uwregid)
×
NEW
21
            return StreamingHttpResponse(
×
22
                [photo.getvalue()], content_type="image/jpeg")
NEW
23
        except Exception:
×
NEW
24
            log_exception(logger, "get_idcard_photo", traceback)
×
NEW
25
    return data_not_found()
×
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

© 2025 Coveralls, Inc