Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds feedback email to document page. Changes date_issued source for … #141

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion app/cache/legislation.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def _to_json(
"language": language if language is not None else "eng",
"format": format if format is not None else "",
"description": description if description is not None else "",
"date_issued": convert_date_string_to_obj(modified),
"date_issued": convert_date_string_to_obj(valid_sort_date),
"date_modified": convert_date_string_to_obj(modified),
"date_valid": valid_sort_date,
"sort_date": valid_sort_date,
Expand Down
21 changes: 15 additions & 6 deletions app/search/templates/document.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,21 @@ <h2 class="govuk-heading-m">Related content on legislation.gov.uk</h2>
</div>
{% endif %}

<h2 class="govuk-heading-m">Regulatory topics</h2>
<ul class="govuk-list orp-topics-list">
{% for topic in result.regulatory_topics %}
<li class="govuk-body-s orp-secondary-text-colour">{{ topic }}</li>
{% endfor %}
</ul>
{% if result.regulatory_topics %}
<h2 class="govuk-heading-m">Regulatory topics</h2>
<ul class="govuk-list orp-topics-list govuk-!-margin-bottom-6">
{% for topic in result.regulatory_topics %}
<li class="govuk-body-s orp-secondary-text-colour">{{ topic }}</li>
{% endfor %}
</ul>
{% endif %}


<p class="govuk-body">
Email <a class="govuk-link" href="mailto:[email protected]">
[email protected]
</a> to report a problem with this result.
</p>
</div>
</div>
</main>
Expand Down
48 changes: 14 additions & 34 deletions fbr/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,43 +113,23 @@

DATABASES: dict = {"default": {}}

# We're going to restructure the below so that we don't end up with
# a sqlite database in production.

# Use DATABASE_URL if it exists, otherwise use sqlite ?
# DATABASES["default"] = dj_database_url.config( # noqa
# default=database_url_from_env("DATABASE_CREDENTIALS")
# )

# if DATABASE_URL := env("DATABASE_URL", default=None):
# DATABASES = {
# "default": {
# **dj_database_url.parse(
# DATABASE_URL,
# engine="postgresql",
# ),
# "ENGINE": "django.db.backends.postgresql",
# }
# }
# else:
# DATABASES = {
# "default": {
# "ENGINE": "django.db.backends.sqlite3",
# "NAME": BASE_DIR / "db.sqlite3",
# }
# }

if DATABASE_URL := env("DATABASE_CREDENTIALS", default=None):
DATABASES["default"] = dj_database_url.config(
default=database_url_from_env("DATABASE_CREDENTIALS")
)
DATABASES["default"]["ENGINE"] = "django.db.backends.postgresql"
else:
if DATABASE_URL := env("DATABASE_URL", default=None):
# Use DATABASE_URL for local development if available in local.env
DATABASES["default"] = dj_database_url.parse(
"",
DATABASE_URL,
engine="postgresql",
)
DATABASES["default"]["ENGINE"] = "django.db.backends.postgresql"
elif DATABASE_CREDENTIALS := env("DATABASE_CREDENTIALS", default=None):
# Use DATABASE_CREDENTIALS (server) for deployed environments
DATABASES["default"] = dj_database_url.config(
default=database_url_from_env(DATABASE_CREDENTIALS)
)
else:
# Empty configuration to allow the codebuild to run without DB config
DATABASES["default"] = dj_database_url.parse("", engine="postgresql")

# Ensure the ENGINE is set correctly
DATABASES["default"]["ENGINE"] = "django.db.backends.postgresql"


AUTH_PASSWORD_VALIDATORS = [
Expand Down
Loading