Skip to content

Commit 46bf8fb

Browse files
committed
The ruffening.
1 parent 3a44c35 commit 46bf8fb

File tree

9 files changed

+61
-15
lines changed

9 files changed

+61
-15
lines changed

src/backoffice/views/backoffice.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323

2424

2525
class BackofficeIndexView(CampViewMixin, RaisePermissionRequiredMixin, TemplateView):
26-
"""The Backoffice index view only requires camps.backoffice_permission so we use RaisePermissionRequiredMixin directly"""
26+
# The Backoffice index view only requires camps.backoffice_permission so,
27+
# we use RaisePermissionRequiredMixin directly
2728

2829
permission_required = "camps.backoffice_permission"
2930
template_name = "index.html"

src/bornhack/environment_settings.py.dist.dev

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23

34
# MODIFY THIS!
45
#
@@ -22,7 +23,8 @@ DATABASES = {
2223
"PORT": os.getenv("POSTGRES_PORT", os.getenv("PGPORT", "5432")),
2324
}
2425
}
25-
DEBUG = True
26+
DEBUG = bool({"runserver"}.intersection(sys.argv))
27+
TESTING = "test" in sys.argv
2628
WKHTMLTOPDF_CMD = "wkhtmltopdf"
2729
CHANNEL_LAYERS = {}
2830

src/camps/views.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ def dispatch(self, request: HttpRequest, *args: list[Any], **kwargs: dict[str, A
5757

5858
# figure out where to redirect
5959
if percentpassed > settings.CAMP_REDIRECT_PERCENT or not prevcamp:
60-
# either we have no previous camp, or we have both and more than settings.CAMP_REDIRECT_PERCENT has passed, so redirect to the next camp
60+
# either we have no previous camp, or we have both and more than settings.CAMP_REDIRECT_PERCENT has passed,
61+
# so redirect to the next camp
6162
camp = nextcamp
6263
else:
63-
# either we have no next camp, or we have both and less than settings.CAMP_REDIRECT_PERCENT has passed, so redirect to the previous camp
64+
# either we have no next camp, or we have both and less than settings.CAMP_REDIRECT_PERCENT has passed,
65+
# so redirect to the previous camp
6466
camp = prevcamp
6567

6668
# do the redirect

src/economy/views.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,10 @@ def form_valid(self, form):
459459

460460
messages.success(
461461
self.request,
462-
f"Reimbursement {reimbursement.pk} has been created. It will be paid by the economy team to the specified bank account.",
462+
(
463+
f"Reimbursement {reimbursement.pk} has been created. It will be paid by the economy team to the "
464+
"specified bank account."
465+
),
463466
)
464467

465468
# send an email to the economy team
@@ -470,7 +473,10 @@ def form_valid(self, form):
470473
),
471474
text_template="emails/reimbursement_created.txt",
472475
formatdict={"reimbursement": reimbursement},
473-
subject=f"New {self.camp.title} reimbursement {reimbursement.pk} for user {reimbursement.reimbursement_user.username} created",
476+
subject=(
477+
f"New {self.camp.title} reimbursement {reimbursement.pk} for user "
478+
f"{reimbursement.reimbursement_user.username} created"
479+
),
474480
to_recipients=[settings.ECONOMYTEAM_EMAIL],
475481
)
476482

src/program/views.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ class SpeakerProposalDeleteView(
332332
EnsureCFPOpenMixin,
333333
DeleteView,
334334
):
335-
"""This view allows a user to delete an existing SpeakerProposal object, as long as it is not linked to any EventProposals"""
335+
"""Allows a user to delete an existing SpeakerProposal object, as long as it is not linked to any EventProposals"""
336336

337337
model = models.SpeakerProposal
338338
template_name = "proposal_delete.html"
@@ -386,7 +386,7 @@ class EventProposalTypeSelectView(
386386
EnsureCFPOpenMixin,
387387
ListView,
388388
):
389-
"""This view is for selecting the type of event to submit (when adding a new event_proposal to an existing speaker_proposal)"""
389+
"""View is to select event type to submit (when adding a new event_proposal to an existing speaker_proposal)"""
390390

391391
model = models.EventType
392392
template_name = "event_type_select.html"
@@ -478,7 +478,8 @@ def form_valid(self, form):
478478
form.instance.speakers.add(self.speaker_proposal)
479479
messages.success(
480480
self.request,
481-
f"{self.speaker_proposal.name} has been added as {form.instance.event_type.host_title} for {form.instance.title}",
481+
f"{self.speaker_proposal.name} has been added as "
482+
f"{form.instance.event_type.host_title} for {form.instance.title}",
482483
)
483484
return redirect(self.get_success_url())
484485

@@ -846,7 +847,11 @@ def form_valid(self, form):
846847

847848
messages.success(
848849
self.request,
849-
f"Your {self.event_type.host_title} proposal and {self.event_type.name} proposal have been submitted for review. You will receive an email when they have been accepted or rejected.",
850+
(
851+
f"Your {self.event_type.host_title} proposal and "
852+
f"{self.event_type.name} proposal have been submitted for review. "
853+
"You will receive an email when they have been accepted or rejected."
854+
),
850855
)
851856

852857
# all good

src/teams/apps.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class TeamsConfig(AppConfig):
1010
name = "teams"
1111

1212
def ready(self) -> None:
13-
# connect the post_save signal, always including a dispatch_uid to prevent it being called multiple times in corner cases
13+
# connect the post_save signal, always including a dispatch_uid to prevent it being
14+
# called multiple times in corner cases
1415
post_save.connect(
1516
teammember_saved,
1617
sender="teams.TeamMember",

src/teams/views/base.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ def dispatch(self, request: HttpRequest, *args: list[Any], **kwargs: dict[str, A
124124
if not request.user.profile.nickserv_username:
125125
messages.error(
126126
request,
127-
"Please go to your profile and set your NickServ username first. Make sure the account is registered with NickServ first!",
127+
(
128+
"Please go to your profile and set your NickServ username first. "
129+
"Make sure the account is registered with NickServ first!"
130+
),
128131
)
129132
return redirect(
130133
"teams:general",
@@ -147,7 +150,10 @@ def get(self, request: HttpRequest, *args: list[Any], **kwargs: dict[str, Any]):
147150
# this membership is already marked as membership.irc_channel_acl_ok=False, no need to do anything
148151
messages.error(
149152
request,
150-
"No need, this membership is already marked as irc_channel_acl_ok=False, so the bot will fix the ACL soon",
153+
(
154+
"No need, this membership is already marked as irc_channel_acl_ok=False, "
155+
"so the bot will fix the ACL soon"
156+
),
151157
)
152158
return redirect(
153159
"teams:general",
@@ -169,7 +175,10 @@ def form_valid(self, form):
169175
membership.save()
170176
messages.success(
171177
self.request,
172-
f"OK, hang on while we fix the permissions for your NickServ user '{self.request.user.profile.nickserv_username}' for IRC channel '{form.instance.irc_channel_name}'",
178+
(
179+
"OK, hang on while we fix the permissions for your NickServ user "
180+
f"'{self.request.user.profile.nickserv_username}' for IRC channel '{form.instance.irc_channel_name}'"
181+
),
173182
)
174183
return redirect(
175184
"teams:general",

src/tokens/views.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ def get(self, request: HttpRequest, *args: list[Any], **kwargs: dict[str, Any]):
9494
# message for the user
9595
messages.success(
9696
self.request,
97-
f"Congratulations! You found a secret token: '{self.get_object().description}' - Your visit has been registered! Keep hunting, there might be more tokens out there.",
97+
(
98+
f"Congratulations! You found a secret token: '{self.get_object().description}' "
99+
"- Your visit has been registered! Keep hunting, there might be more tokens out there."
100+
),
98101
)
99102
return redirect(reverse("tokens:tokenfind_list"))
100103

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 4.2.14 on 2024-08-25 20:00
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('villages', '0012_village_approved'),
10+
]
11+
12+
operations = [
13+
migrations.AlterModelOptions(
14+
name='village',
15+
options={'ordering': ('name',)},
16+
),
17+
]

0 commit comments

Comments
 (0)