Skip to content

Commit

Permalink
remove "vintage" use, as it doesn't work
Browse files Browse the repository at this point in the history
Vintage is no longer a Ranger status, so it never shows up.
We could start reading the new Vintage attribute instead, but
no one has asked for that yet.

fixes #367
  • Loading branch information
srabraham committed Feb 12, 2025
1 parent 78beec5 commit 34e80d0
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 20 deletions.
3 changes: 1 addition & 2 deletions src/ims/directory/clubhouse_db/_dms.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ async def _queryRangersByID(self) -> Mapping[str, Ranger]:
on_site,
password
from person
where status in ('active', 'inactive', 'vintage', 'auditor')
where status in ('active', 'inactive', 'auditor')
"""
self._log.debug("EXECUTE DMS: {sql}", sql=sql)
rows = await self.dbpool.runQuery(sql)
Expand Down Expand Up @@ -324,5 +324,4 @@ def statusFromID(strValue: str) -> RangerStatus:
return {
"active": RangerStatus.active,
"inactive": RangerStatus.inactive,
"vintage": RangerStatus.vintage,
}.get(strValue, RangerStatus.other)
6 changes: 3 additions & 3 deletions src/ims/directory/clubhouse_db/test/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def fixPassword(
"id, callsign, "
"email, status, on_site, password "
"from person where status in "
"('active', 'inactive', 'vintage', 'auditor')"
"('active', 'inactive', 'auditor')"
):
rows = (fixPassword(p) for p in cannedPersonnel)
return succeed(rows) # type: ignore[arg-type]
Expand Down Expand Up @@ -153,15 +153,15 @@ def __init__(self) -> None:
5,
"Tool",
"tool@example.com",
"vintage",
"active",
True,
"toolpass",
),
(
6,
"Tulsa",
"tulsa@example.com",
"vintage",
"active",
True,
"tulsapass",
),
Expand Down
1 change: 0 additions & 1 deletion src/ims/directory/file/_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def statusFromID(strValue: str) -> RangerStatus:
return {
"active": RangerStatus.active,
"inactive": RangerStatus.inactive,
"vintage": RangerStatus.vintage,
}.get(strValue, RangerStatus.other)


Expand Down
3 changes: 1 addition & 2 deletions src/ims/directory/file/test/test_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,10 @@ def test_statusFromID_known(self) -> None:
for name, status in (
("active", RangerStatus.active),
("inactive", RangerStatus.inactive),
("vintage", RangerStatus.vintage),
):
self.assertIdentical(statusFromID(name), status)

@given(text().filter(lambda name: name not in ("active", "inactive", "vintage")))
@given(text().filter(lambda name: name not in ("active", "inactive")))
@settings(max_examples=10)
def test_statusFromID_unknown(self, name: str) -> None:
self.assertIdentical(statusFromID(name), RangerStatus.other)
Expand Down
9 changes: 1 addition & 8 deletions src/ims/element/static/incident.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ function loadPersonnel(success) {
// FIXME: better yet: filter based on on-playa state
switch (record.status) {
case "active":
case "vintage":
break;
default:
continue;
Expand Down Expand Up @@ -572,13 +571,7 @@ function drawRangersToAdd() {


function rangerAsString(ranger) {
let result = ranger.handle;

if (ranger.status === "vintage") {
result += "*";
}

return result;
return ranger.handle;
}


Expand Down
2 changes: 0 additions & 2 deletions src/ims/model/_ranger.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
statusDescriptions = {
"active": "Active Ranger",
"inactive": "Inactive Ranger",
"vintage": "Vintage Ranger",
"other": "(Unknown Person Type)",
}

Expand All @@ -49,7 +48,6 @@ class RangerStatus(Names):

active = auto()
inactive = auto()
vintage = auto()

other = auto()

Expand Down
1 change: 0 additions & 1 deletion src/ims/model/jsons/_ranger.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class RangerStatusJSONValue(Enum):

active = "active"
inactive = "inactive"
vintage = "vintage"
other = "(unknown)"


Expand Down
1 change: 0 additions & 1 deletion src/ims/model/jsons/test/json_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def jsonFromRangerStatus(status: RangerStatus) -> str:
return {
RangerStatus.active: "active",
RangerStatus.inactive: "inactive",
RangerStatus.vintage: "vintage",
RangerStatus.other: "(unknown)",
}[status]

Expand Down

0 comments on commit 34e80d0

Please sign in to comment.