Skip to content

Commit

Permalink
Merge pull request #586 from CityOfNewYork/johnyu95-close-requests-cli
Browse files Browse the repository at this point in the history
Fix Super Function for Responses
  • Loading branch information
johnyu95 authored Nov 12, 2024
2 parents d041a98 + 2e2ad37 commit 7ff8848
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
26 changes: 14 additions & 12 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1589,9 +1589,9 @@ class Notes(Responses):
content = db.Column(db.String)

def __init__(
self, request_id, privacy, content, date_modified=None, is_editable=False
self, request_id, privacy, content, date_modified=None, release_date=None, is_editable=False
):
super(Notes, self).__init__(request_id, privacy, date_modified, is_editable)
super(Notes, self).__init__(request_id, privacy, date_modified, release_date, is_editable)
self.content = content

@property
Expand Down Expand Up @@ -1630,6 +1630,7 @@ def __init__(
size,
hash_,
date_modified=None,
release_date=None,
is_editable=False,
is_dataset=False,
dataset_description=None
Expand All @@ -1646,7 +1647,7 @@ def __init__(
sentry.captureException()
raise DuplicateFileException(file_name=name, request_id=request_id)

super(Files, self).__init__(request_id, privacy, date_modified, is_editable, is_dataset, dataset_description)
super(Files, self).__init__(request_id, privacy, date_modified, release_date, is_editable, is_dataset, dataset_description)
self.name = name
self.mime_type = mime_type
self.title = title
Expand Down Expand Up @@ -1674,9 +1675,9 @@ class Links(Responses):
url = db.Column(db.String)

def __init__(
self, request_id, privacy, title, url, date_modified=None, is_editable=False, is_dataset=False, dataset_description=None
self, request_id, privacy, title, url, date_modified=None, release_date=None, is_editable=False, is_dataset=False, dataset_description=None
):
super(Links, self).__init__(request_id, privacy, date_modified, is_editable, is_dataset, dataset_description)
super(Links, self).__init__(request_id, privacy, date_modified, release_date, is_editable, is_dataset, dataset_description)
self.title = title
self.url = url

Expand All @@ -1699,10 +1700,10 @@ class Instructions(Responses):
content = db.Column(db.String)

def __init__(
self, request_id, privacy, content, date_modified=None, is_editable=False
self, request_id, privacy, content, date_modified=None, release_date=None, is_editable=False
):
super(Instructions, self).__init__(
request_id, privacy, date_modified, is_editable
request_id, privacy, date_modified, release_date, is_editable
)
self.content = content

Expand Down Expand Up @@ -1742,9 +1743,10 @@ def __init__(
subject,
body,
date_modified=None,
release_date=None,
is_editable=False,
):
super(Emails, self).__init__(request_id, privacy, date_modified, is_editable)
super(Emails, self).__init__(request_id, privacy, date_modified, release_date, is_editable)
self.to = to
self.cc = cc
self.bcc = bcc
Expand Down Expand Up @@ -1774,9 +1776,9 @@ class Envelopes(Responses):
latex = db.Column(db.String)

def __init__(
self, request_id, privacy, latex, date_modified=None, is_editable=False
self, request_id, privacy, latex, date_modified=None, release_date=None, is_editable=False
):
super(Envelopes, self).__init__(request_id, privacy, date_modified, is_editable)
super(Envelopes, self).__init__(request_id, privacy, date_modified, release_date, is_editable)
self.latex = latex

@property
Expand Down Expand Up @@ -1841,9 +1843,9 @@ class Letters(Responses):
content = db.Column(db.String)

def __init__(
self, request_id, privacy, title, content, date_modified=None, is_editable=False
self, request_id, privacy, title, content, date_modified=None, release_date=None, is_editable=False
):
super(Letters, self).__init__(request_id, privacy, date_modified, is_editable)
super(Letters, self).__init__(request_id, privacy, date_modified, release_date, is_editable)
self.title = title
self.content = content

Expand Down
2 changes: 1 addition & 1 deletion app/request/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def view(request_id):
"""
try:
current_request = Requests.query.filter_by(id=request_id).one()
assert current_request.agency.is_active
assert current_request.agency.is_active or current_request.status is request_status.CLOSED
except NoResultFound:
print("Request with id '{}' does not exist.".format(request_id))
sentry.captureException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<p>Expected date of completion: <strong>{{ moment(response.date).format('dddd, MM/DD/YYYY [at] h:mm A')}}</strong></p>
{% if response.reason is not none %}
<div class="request-description-text">
{{ response.content | safe }}
{{ response.reason | safe }}
</div>
{% endif %}
{% elif response.dtype == determination_type.EXTENSION %}
<p>Due date changed to: <strong>{{ moment(response.date).format('dddd, MM/DD/YYYY [at] h:mm A') }}</strong></p>
{% if response.reason is not none %}
<div class="request-description-text">
{{ response.content | safe }}
{{ response.reason | safe }}
</div>
{% endif %}
{% elif response.dtype in (determination_type.DENIAL, determination_type.CLOSING) %}
Expand Down

0 comments on commit 7ff8848

Please sign in to comment.