Skip to content

Commit

Permalink
update e2e server config
Browse files Browse the repository at this point in the history
  • Loading branch information
devketanpro committed Jul 25, 2024
1 parent feb3304 commit 5ec81c6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion e2e/server/Procfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
web: gunicorn -b 0.0.0.0:$PORT -w 3 newsroom.web.app:app
web: hypercorn -c file:hypercorn_config.py newsroom.web.app:asgi_app
websocket: python -m newsroom.web.ws
worker: celery -A newsroom.web.worker.celery worker
beat: celery -A newsroom.web.worker.celery beat
10 changes: 10 additions & 0 deletions e2e/server/hypercorn_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import os

bind = "0.0.0.0:%s" % os.environ.get("PORT", "5000")
workers = int(os.environ.get("WEB_CONCURRENCY", 3))
timeout = int(os.environ.get("WEB_TIMEOUT", 30))

accesslog = "-"
access_log_format = "%(m)s %(U)s status=%(s)s time=%(T)ss size=%(B)sb"

use_reloader = "NEWSROOM_RELOAD" in os.environ
8 changes: 6 additions & 2 deletions newsroom/reports/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from newsroom.utils import query_resource

from .utils import get_current_user_reports
from newsroom.users import get_user_profile_data


@blueprint.route("/reports/print/<report>", methods=["GET"])
Expand All @@ -26,15 +27,18 @@ def print_reports(report):

@blueprint.route("/reports/company_reports", methods=["GET"])
@account_manager_or_company_admin_only
def company_reports():
async def company_reports():
companies = list(query_resource("companies"))
user_profile_data = await get_user_profile_data()
data = {
"companies": companies,
"sections": newsroom_app.sections,
"api_enabled": app.config.get("NEWS_API_ENABLED", False),
"current_user_type": session.get("user_type"),
}
return render_template("company_reports.html", setting_type="company_reports", data=data)
return render_template(
"company_reports.html", setting_type="company_reports", data=data, user_profile_data=user_profile_data
)


@blueprint.route("/reports/<report>", methods=["GET"])
Expand Down

0 comments on commit 5ec81c6

Please sign in to comment.