fix(fastapi): pass request type's name to Request*Notification

Previously, we passed the straight up request type instance from
SQLAlchemy and had a .title() function that was transparently
treating the instance the same as the instance's Name in terms
of notify.py's use of it.

This commit removes that transparent behavior; it was not actually
intended.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-10-18 20:12:06 -07:00
parent 3b28be1741
commit b4092fe77d
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
2 changed files with 9 additions and 14 deletions

View file

@ -17,14 +17,7 @@ class RequestType(Base):
def name_display(self) -> str:
""" Return the Name column with its first char capitalized. """
name = self.Name
return name[0].upper() + name[1:]
def title(self) -> str:
return self.name_display()
def __getitem__(self, n: int) -> str:
return self.Name[n]
return self.Name.title()
DELETION_ID = db.query(RequestType, RequestType.Name == DELETION).first().ID