Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions mpcontribs-api/gunicorn.conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
statsd_host = "{}:8125".format(os.getenv("DD_AGENT_HOST"))
accesslog = "-"
errorlog = "-"
access_log_format = '{}/{}: %(h)s %(t)s %(m)s %(U)s?%(q)s %(H)s %(s)s %(b)s "%(f)s" "%(a)s" %(D)s %(p)s %({{x-consumer-id}}i)s'.format(
os.getenv("SUPERVISOR_GROUP_NAME"), os.getenv("SUPERVISOR_PROCESS_NAME")
)
access_log_format = (
'{}/{}: %(h)s %(t)s %(m)s %(U)s?%(q)s %(H)s %(s)s %(b)s "%(f)s" "%(a)s" %(D)s %(p)s %({{x-consumer-id}}i)s'
.format(os.getenv("SUPERVISOR_GROUP_NAME"),
os.getenv("SUPERVISOR_PROCESS_NAME"))
)
max_requests = os.getenv("MAX_REQUESTS")
max_requests_jitter = os.getenv("MAX_REQUESTS_JITTER")
proc_name = os.getenv("SUPERVISOR_PROCESS_NAME")
Expand Down
3 changes: 2 additions & 1 deletion mpcontribs-api/mpcontribs/api/attachments/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def post_init(cls, sender, document, **kwargs):
if "content" in requested_fields:
if not document.md5:
# document.reload("md5") # TODO AttributeError: _changed_fields
raise ValueError("Please also request md5 field to retrieve attachment content!")
raise ValueError(
"Please also request md5 field to retrieve attachment content!")

retr = s3_client.get_object(Bucket=BUCKET, Key=document.md5)
document.content = b64encode(retr["Body"].read()).decode("utf-8")
Expand Down
2 changes: 1 addition & 1 deletion mpcontribs-api/mpcontribs/api/contributions/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def format_cell(cell):
q = truncate_digits(q)
try:
return str(q.nominal_value) if isnan(q.std_dev) else str(q)
except Exception:
except UnicodeEncodeError:
return cell


Expand Down
Loading