-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
2,717 additions
and
1,470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django.db import models | ||
|
||
|
||
class BaseChoices(models.TextChoices): | ||
@classmethod | ||
def active_choices(cls): | ||
return [choice for choice in cls.choices if choice[0] not in cls.inactive_choices()] | ||
|
||
@classmethod | ||
def inactive_choices(cls): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...o_app/feedback/migrations/0004_feedbackitem_user_email_feedbackitem_user_name_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Generated by Django 4.2.16 on 2024-12-18 16:41 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("feedback", "0003_feedbackitem_url_historicalfeedbackitem_url"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="feedbackitem", | ||
name="user_email", | ||
field=models.EmailField(blank=True, max_length=254, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="feedbackitem", | ||
name="user_name", | ||
field=models.CharField(blank=True, max_length=255, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="historicalfeedbackitem", | ||
name="user_email", | ||
field=models.EmailField(blank=True, max_length=254, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="historicalfeedbackitem", | ||
name="user_name", | ||
field=models.CharField(blank=True, max_length=255, null=True), | ||
), | ||
] |
27 changes: 27 additions & 0 deletions
27
django_app/feedback/migrations/0005_alter_feedbackitem_rating_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 4.2.16 on 2024-12-27 21:23 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("feedback", "0004_feedbackitem_user_email_feedbackitem_user_name_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="feedbackitem", | ||
name="rating", | ||
field=models.IntegerField( | ||
choices=[(5, "Very satisfied"), (4, "Satisfied"), (3, "Neutral"), (2, "Dissatisfied"), (1, "Very dissatisfied")] | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="historicalfeedbackitem", | ||
name="rating", | ||
field=models.IntegerField( | ||
choices=[(5, "Very satisfied"), (4, "Satisfied"), (3, "Neutral"), (2, "Dissatisfied"), (1, "Very dissatisfied")] | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
django_app/feedback/templates/feedback/participate_in_user_research.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h2 class="govuk-heading-m">Participating in further research</h2> | ||
<p class="govuk-body">We're always improving our services and would like your help to make this one better. If you're happy for us to contact you about participating in further research, please leave your name and email address.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
import boto3 | ||
import sentry_sdk | ||
from core.document_storage import PermanentDocumentStorage, TemporaryDocumentStorage | ||
from django.conf import settings | ||
|
||
|
||
def s3_check() -> bool: | ||
""" | ||
Performs a check on the S3 connection | ||
Check if the S3 bucket exists and ensure the app can access it. | ||
https://boto3.amazonaws.com/v1/documentation/api/1.35.9/reference/services/s3/client/head_bucket.html | ||
""" | ||
temporary_document_bucket = TemporaryDocumentStorage().bucket | ||
permanent_document_bucket = PermanentDocumentStorage().bucket | ||
client = boto3.client("s3") | ||
|
||
bucket_names = [settings.TEMPORARY_S3_BUCKET_NAME, settings.PERMANENT_S3_BUCKET_NAME] | ||
|
||
try: | ||
assert temporary_document_bucket.creation_date | ||
assert permanent_document_bucket.creation_date | ||
return True | ||
for bucket_name in bucket_names: | ||
client.head_bucket(Bucket=bucket_name) | ||
except Exception as e: | ||
sentry_sdk.capture_exception(e) | ||
return False | ||
|
||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.