-
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.
Merge pull request #18 from uktrade/DST-223
DST-223: Add the example Sanctions Regimes and admin panel
- Loading branch information
Showing
14 changed files
with
378 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
from django.contrib import admin | ||
|
||
from report_a_breach.core.models import SanctionsRegime | ||
|
||
# Register your models here. | ||
admin.site.register(SanctionsRegime) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
from django.urls import path | ||
from django.urls import re_path | ||
from django.urls import path, re_path | ||
|
||
from .views import LandingView | ||
from .views import ReportABreachWizardView | ||
from .views import ReportSubmissionCompleteView | ||
from .views import SummaryView | ||
from .views import LandingView, ReportABreachWizardView, ReportSubmissionCompleteView | ||
|
||
report_a_breach_wizard = ReportABreachWizardView.as_view( | ||
url_name="report_a_breach_step", done_step_name="finished" | ||
url_name="report_a_breach_step", done_step_name="confirmation" | ||
) | ||
|
||
urlpatterns = [ | ||
path("landing", LandingView.as_view(), name="landing"), | ||
path("summary/<uuid:pk>/", SummaryView.as_view(), name="summary"), | ||
path("confirmation/<uuid:pk>", ReportSubmissionCompleteView.as_view(), name="confirmation"), | ||
path("confirmation", ReportSubmissionCompleteView.as_view(), name="confirmation"), | ||
path("report_a_breach", report_a_breach_wizard, name="report_a_breach"), | ||
re_path(r"report_a_breach/(?P<step>.+)/$", report_a_breach_wizard, name="report_a_breach_step"), | ||
] |
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
191 changes: 191 additions & 0 deletions
191
report_a_breach/migrations/0002_breach_personorcompany_sanctionsregime_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,191 @@ | ||
# Generated by Django 4.2.9 on 2024-01-29 09:10 | ||
|
||
import uuid | ||
|
||
import django.db.models.deletion | ||
import django_countries.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("report_a_breach", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Breach", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, editable=False, primary_key=True, serialize=False | ||
), | ||
), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
("modified_at", models.DateTimeField(auto_now=True)), | ||
( | ||
"reporter_professional_relationship", | ||
models.TextField( | ||
choices=[ | ||
( | ||
"owner", | ||
"I'm an owner, officer or employee of the company, or I am the person", | ||
), | ||
( | ||
"acting", | ||
"I do not work for the company, but I'm acting on their behalf to make a voluntary declaration", | ||
), | ||
( | ||
"third_party", | ||
"I work for a third party with a legal responsibility to make a mandatory declaration", | ||
), | ||
( | ||
"no_professional_relationship", | ||
"I do not have a professional relationship with the company or person or I no longer have a professional relationship with them", | ||
), | ||
], | ||
verbose_name="What is the professional relationship with the company or person suspected of breaching sanctions?", | ||
), | ||
), | ||
( | ||
"reporter_email_address", | ||
models.EmailField(max_length=254, verbose_name="What is your email address?"), | ||
), | ||
("reporter_full_name", models.TextField(verbose_name="What is your full name?")), | ||
( | ||
"additional_information", | ||
models.TextField(verbose_name="Tell us about the suspected breach"), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="PersonOrCompany", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, editable=False, primary_key=True, serialize=False | ||
), | ||
), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
("modified_at", models.DateTimeField(auto_now=True)), | ||
( | ||
"person_or_company", | ||
models.CharField( | ||
choices=[("person", "Person"), ("company", "Company")], max_length=7 | ||
), | ||
), | ||
("name", models.TextField()), | ||
("website", models.URLField(null=True)), | ||
("address_line_1", models.TextField()), | ||
("address_line_2", models.TextField(null=True)), | ||
("address_line_3", models.TextField(null=True)), | ||
("address_line_4", models.TextField(null=True)), | ||
("town_or_city", models.TextField()), | ||
("county", django_countries.fields.CountryField(max_length=2)), | ||
("postcode", models.TextField()), | ||
( | ||
"type_of_relationship", | ||
models.CharField( | ||
choices=[ | ||
("breacher", "Breacher"), | ||
("supplier", "Supplier"), | ||
("recipient", "Recipient"), | ||
], | ||
max_length=9, | ||
), | ||
), | ||
( | ||
"breach", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="report_a_breach.breach" | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="SanctionsRegime", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, editable=False, primary_key=True, serialize=False | ||
), | ||
), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
("modified_at", models.DateTimeField(auto_now=True)), | ||
("short_name", models.TextField()), | ||
("full_name", models.TextField()), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="SanctionsRegimeBreachThrough", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, editable=False, primary_key=True, serialize=False | ||
), | ||
), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
("modified_at", models.DateTimeField(auto_now=True)), | ||
( | ||
"breach", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="report_a_breach.breach" | ||
), | ||
), | ||
( | ||
"sanctions_regime", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="report_a_breach.sanctionsregime", | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="UploadedDocument", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, editable=False, primary_key=True, serialize=False | ||
), | ||
), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
("modified_at", models.DateTimeField(auto_now=True)), | ||
("file", models.FileField(upload_to="")), | ||
( | ||
"breach", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="report_a_breach.breach" | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name="breach", | ||
name="sanctions_regimes", | ||
field=models.ManyToManyField( | ||
through="report_a_breach.SanctionsRegimeBreachThrough", | ||
to="report_a_breach.sanctionsregime", | ||
), | ||
), | ||
] |
16 changes: 16 additions & 0 deletions
16
report_a_breach/migrations/0003_remove_breach_sanctions_regimes.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,16 @@ | ||
# Generated by Django 4.2.9 on 2024-01-29 09:16 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("report_a_breach", "0002_breach_personorcompany_sanctionsregime_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="breach", | ||
name="sanctions_regimes", | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
report_a_breach/migrations/0004_breach_sanctions_regimes.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,20 @@ | ||
# Generated by Django 4.2.9 on 2024-01-31 11:31 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("report_a_breach", "0003_remove_breach_sanctions_regimes"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="breach", | ||
name="sanctions_regimes", | ||
field=models.ManyToManyField( | ||
through="report_a_breach.SanctionsRegimeBreachThrough", | ||
to="report_a_breach.sanctionsregime", | ||
), | ||
), | ||
] |
Oops, something went wrong.