Skip to content

Commit

Permalink
Assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
michplunkett committed Dec 20, 2024
1 parent 4c7dc89 commit d1a231a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions OpenOversight/app/models/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ class Assignment(BaseModel, TrackUpdates):
resign_date = db.Column(db.Date, index=True, unique=False, nullable=True)

def __repr__(self):
return f"<Assignment: ID {self.officer_id} : {self.star_no}>"
return f"<Assignment ID: {self.officer_id} : {self.star_no}>"

@property
def start_date_or_min(self):
Expand Down Expand Up @@ -656,13 +656,13 @@ class Link(BaseModel, TrackUpdates):
author = db.Column(db.String(255), nullable=True)
has_content_warning = db.Column(db.Boolean, nullable=False, default=False)

def __repr__(self):
return f"<Link ID: {self.id} : {self.title}>"

@validates("url")
def validate_url(self, key, url):
return url_validator(url)

def __repr__(self):
return f"<Link ID: {self.id} : {self.title}>"


class Incident(BaseModel, TrackUpdates):
__tablename__ = "incidents"
Expand Down
2 changes: 1 addition & 1 deletion OpenOversight/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_assignment_repr(mockdata):
assignment = Assignment.query.first()
assert (
repr(assignment)
== f"<Assignment: ID {assignment.base_officer.id} : {assignment.star_no}>"
== f"<Assignment ID: {assignment.base_officer.id} : {assignment.star_no}>"
)


Expand Down

0 comments on commit d1a231a

Please sign in to comment.