Skip to content
Open
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
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3.9
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
rev: v4.6.0
hooks:
- id: check-merge-conflict
- id: check-added-large-files
Expand All @@ -15,27 +15,27 @@ repos:
- id: pretty-format-json
args: ["--autofix", "--allow-missing-credentials"]
- repo: https://github.com/PyCQA/isort
rev: 5.6.4
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://gitlab.com/pycqa/flake8
rev: "8f9b4931b9a28896fb43edccb23016a7540f5b82"
- repo: https://github.com/PyCQA/flake8
rev: "7.0.0"
hooks:
- id: flake8
additional_dependencies: [flake8-print]
files: '\.py$'
args:
- --select=F401,F406,F821,T003
- repo: https://github.com/humitos/mirrors-autoflake
rev: v1.3
rev: v1.1
hooks:
- id: autoflake
files: '\.py$'
exclude: '^\..*'
args: ["--in-place", "--remove-all-unused-imports"]
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 24.4.2
hooks:
- id: black
args: ["--target-version", "py38"]
8 changes: 6 additions & 2 deletions accounts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ class Migration(migrations.Migration):
("last_name", models.CharField(max_length=32)),
("is_superuser", models.BooleanField()),
],
options={"abstract": False,},
managers=[("objects", accounts.managers.AccountManager()),],
options={
"abstract": False,
},
managers=[
("objects", accounts.managers.AccountManager()),
],
),
]
7 changes: 5 additions & 2 deletions accounts/migrations/0003_auto_20200715_0405.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class Migration(migrations.Migration):

operations = [
migrations.AlterModelOptions(
name="account", options={"ordering": ["first_name"]},
name="account",
options={"ordering": ["first_name"]},
),
migrations.CreateModel(
name="Shift",
Expand Down Expand Up @@ -44,6 +45,8 @@ class Migration(migrations.Migration):
),
),
],
options={"ordering": ["-date"],},
options={
"ordering": ["-date"],
},
),
]
4 changes: 3 additions & 1 deletion common/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def post(self, request):
for chunk in new_template.chunks():
destination.write(chunk)
messages.add_message(
request, messages.SUCCESS, "The settings have been sucessfully saved.",
request,
messages.SUCCESS,
"The settings have been sucessfully saved.",
)

form = SettingsForm()
Expand Down
4 changes: 3 additions & 1 deletion invoices/migrations/0002_auto_20200510_0147.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Migration(migrations.Migration):

operations = [
migrations.RenameField(
model_name="invoiceitem", old_name="hours", new_name="worked_hours",
model_name="invoiceitem",
old_name="hours",
new_name="worked_hours",
),
]
4 changes: 3 additions & 1 deletion invoices/migrations/0003_auto_20200510_2040.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Migration(migrations.Migration):

operations = [
migrations.RenameField(
model_name="invoiceitem", old_name="title", new_name="description",
model_name="invoiceitem",
old_name="title",
new_name="description",
),
]
13 changes: 10 additions & 3 deletions invoices/migrations/0006_auto_20200610_0320.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,22 @@ class Migration(migrations.Migration):
],
),
migrations.RenameField(
model_name="invoice", old_name="guid", new_name="invoice_id",
model_name="invoice",
old_name="guid",
new_name="invoice_id",
),
migrations.RemoveField(
model_name="invoice",
name="hourly_rate",
),
migrations.RemoveField(model_name="invoice", name="hourly_rate",),
migrations.AlterField(
model_name="invoice",
name="status",
field=models.PositiveSmallIntegerField(default=0),
),
migrations.DeleteModel(name="InvoiceItem",),
migrations.DeleteModel(
name="InvoiceItem",
),
migrations.AddField(
model_name="item",
name="invoice",
Expand Down
6 changes: 3 additions & 3 deletions invoices/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def get(self, request):
)
return HttpResponseRedirect(reverse("invoices:list"))
response = HttpResponse(pdf, content_type="application/pdf")
response[
"Content-Disposition"
] = f'inline; filename="{self.invoice.invoice_id}.pdf"'
response["Content-Disposition"] = (
f'inline; filename="{self.invoice.invoice_id}.pdf"'
)
return response


Expand Down
4 changes: 3 additions & 1 deletion partners/migrations/0002_partner_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Migration(migrations.Migration):

operations = [
migrations.AddField(
model_name="partner", name="notes", field=models.TextField(blank=True),
model_name="partner",
name="notes",
field=models.TextField(blank=True),
),
]
12 changes: 9 additions & 3 deletions partners/migrations/0003_auto_20200510_2052.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ class Migration(migrations.Migration):

operations = [
migrations.RenameField(
model_name="partner", old_name="manager_email", new_name="contact_email",
model_name="partner",
old_name="manager_email",
new_name="contact_email",
),
migrations.RenameField(
model_name="partner", old_name="manager_name", new_name="contact_name",
model_name="partner",
old_name="manager_name",
new_name="contact_name",
),
migrations.RenameField(
model_name="partner", old_name="manager_phone", new_name="contact_phone",
model_name="partner",
old_name="manager_phone",
new_name="contact_phone",
),
]
4 changes: 3 additions & 1 deletion partners/migrations/0004_auto_20200609_0514.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Migration(migrations.Migration):

operations = [
migrations.RenameField(
model_name="partner", old_name="guid", new_name="partner_id",
model_name="partner",
old_name="guid",
new_name="partner_id",
),
]
3 changes: 2 additions & 1 deletion partners/migrations/0007_auto_20200715_0156.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Migration(migrations.Migration):

operations = [
migrations.AlterModelOptions(
name="partner", options={"ordering": ["company"]},
name="partner",
options={"ordering": ["company"]},
),
]
14 changes: 11 additions & 3 deletions servers/migrations/0002_auto_20200612_0325.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ class Migration(migrations.Migration):
]

operations = [
migrations.RemoveField(model_name="server", name="ip_address",),
migrations.RemoveField(model_name="server", name="linode_label",),
migrations.RemoveField(
model_name="server",
name="ip_address",
),
migrations.RemoveField(
model_name="server",
name="linode_label",
),
migrations.AlterField(
model_name="server", name="services", field=models.TextField(),
model_name="server",
name="services",
field=models.TextField(),
),
migrations.AlterField(
model_name="server",
Expand Down
4 changes: 3 additions & 1 deletion tests/test_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def test_incorrect_password(self):
response, "The email and/or password you entered are incorrect."
)
response = self.client.post(
"/accounts/login/", {"email": self.user.email, "password": ""}, follow=True,
"/accounts/login/",
{"email": self.user.email, "password": ""},
follow=True,
)
self.assertContains(response, "This field is required.")
response = self.client.post(
Expand Down