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

uw-it-aca / pathways / 17595439511

09 Sep 2025 08:57PM UTC coverage: 59.134% (-38.7%) from 97.822%
17595439511

Pull #290

github

web-flow
Merge 5c7037084 into 00470d61e
Pull Request #290: Revert "Develop"

14 of 71 new or added lines in 11 files covered. (19.72%)

377 existing lines in 21 files now uncovered.

628 of 1062 relevant lines covered (59.13%)

0.59 hits per line

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

24.32
/pathways/views/api/user.py
1
# Copyright 2025 UW-IT, University of Washington
2
# SPDX-License-Identifier: Apache-2.0
3

4
from pathways.views.api import RESTDispatch
1✔
5
from pathways.models.user import User
1✔
6
from django.utils.decorators import method_decorator
1✔
7
from django.contrib.auth.decorators import login_required
1✔
8
from uw_saml.utils import get_user
1✔
9
import json
1✔
10

11

12
@method_decorator(login_required, name="dispatch")
1✔
13
class UserPreference(RESTDispatch):
1✔
14
    def post(self, request, *args, **kwargs):
1✔
UNCOV
15
        uwnetid = get_user(self.request)
×
UNCOV
16
        request_params = json.loads(request.body)
×
UNCOV
17
        welcome_display = request_params.get("viewed_welcome_display")
×
UNCOV
18
        bottleneck_display = request_params.get("viewed_bottleneck_banner")
×
UNCOV
19
        outcomes_display = request_params.get("viewed_outcomes_banner")
×
UNCOV
20
        coi_display = request_params.get("viewed_coi_banner")
×
21

UNCOV
22
        user, created = \
×
23
            User.objects.get_or_create(uwnetid=uwnetid)
UNCOV
24
        user_updated = False
×
UNCOV
25
        if welcome_display is not None:
×
UNCOV
26
            if welcome_display != user.has_viewed_welcome:
×
UNCOV
27
                user_updated = True
×
UNCOV
28
                user.has_viewed_welcome = welcome_display
×
UNCOV
29
        if bottleneck_display is not None:
×
UNCOV
30
            if bottleneck_display != user.has_viewed_bottleneck_banner:
×
UNCOV
31
                user_updated = True
×
UNCOV
32
                user.has_viewed_bottleneck_banner = bottleneck_display
×
UNCOV
33
        if outcomes_display is not None:
×
UNCOV
34
            if outcomes_display != user.has_viewed_outcomes_banner:
×
UNCOV
35
                user_updated = True
×
UNCOV
36
                user.has_viewed_outcomes_banner = outcomes_display
×
UNCOV
37
        if coi_display is not None:
×
NEW
38
            if coi_display != user.has_viewed_outcomes_banner:
×
UNCOV
39
                user_updated = True
×
UNCOV
40
                user.has_viewed_coi_banner = coi_display
×
UNCOV
41
        if user_updated:
×
UNCOV
42
            user.save()
×
UNCOV
43
            return self.json_response(status=200)
×
44
        else:
UNCOV
45
            return self.json_response(status=304)
×
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