Skip to content

Commit 9b0ed83

Browse files
author
Connor Bechthold
committed
run ze linter
1 parent cc99796 commit 9b0ed83

File tree

5 files changed

+50
-36
lines changed

5 files changed

+50
-36
lines changed

backend/app/models/residents.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Residents(db.Model):
2828
db.CheckConstraint(
2929
"date_left IS NULL OR date_left > date_joined", name="check_date_left_valid"
3030
),
31-
db.UniqueConstraint('initial', 'room_num'),
31+
db.UniqueConstraint("initial", "room_num"),
3232
)
3333

3434
def to_dict(self, include_relationships=False):

backend/migrations/versions/6ba7859cdf27_add_unique_constraint_to_combined_.py

+28-17
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,45 @@
1010
from sqlalchemy.dialects import postgresql
1111

1212
# revision identifiers, used by Alembic.
13-
revision = '6ba7859cdf27'
14-
down_revision = 'a1f05c8f324c'
13+
revision = "6ba7859cdf27"
14+
down_revision = "a1f05c8f324c"
1515
branch_labels = None
1616
depends_on = None
1717

1818

1919
def upgrade():
2020
# ### commands auto generated by Alembic - please adjust! ###
21-
op.drop_table('entities')
22-
with op.batch_alter_table('residents', schema=None) as batch_op:
23-
batch_op.create_unique_constraint(None, ['initial', 'room_num'])
21+
op.drop_table("entities")
22+
with op.batch_alter_table("residents", schema=None) as batch_op:
23+
batch_op.create_unique_constraint(None, ["initial", "room_num"])
2424

2525
# ### end Alembic commands ###
2626

2727

2828
def downgrade():
2929
# ### commands auto generated by Alembic - please adjust! ###
30-
with op.batch_alter_table('residents', schema=None) as batch_op:
31-
batch_op.drop_constraint(None, type_='unique')
32-
33-
op.create_table('entities',
34-
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
35-
sa.Column('string_field', sa.VARCHAR(), autoincrement=False, nullable=False),
36-
sa.Column('int_field', sa.INTEGER(), autoincrement=False, nullable=False),
37-
sa.Column('enum_field', postgresql.ENUM('A', 'B', 'C', 'D', name='enum'), autoincrement=False, nullable=False),
38-
sa.Column('string_array_field', postgresql.ARRAY(sa.VARCHAR()), autoincrement=False, nullable=False),
39-
sa.Column('bool_field', sa.BOOLEAN(), autoincrement=False, nullable=False),
40-
sa.Column('file_name', sa.VARCHAR(), autoincrement=False, nullable=True),
41-
sa.PrimaryKeyConstraint('id', name='entities_pkey')
30+
with op.batch_alter_table("residents", schema=None) as batch_op:
31+
batch_op.drop_constraint(None, type_="unique")
32+
33+
op.create_table(
34+
"entities",
35+
sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False),
36+
sa.Column("string_field", sa.VARCHAR(), autoincrement=False, nullable=False),
37+
sa.Column("int_field", sa.INTEGER(), autoincrement=False, nullable=False),
38+
sa.Column(
39+
"enum_field",
40+
postgresql.ENUM("A", "B", "C", "D", name="enum"),
41+
autoincrement=False,
42+
nullable=False,
43+
),
44+
sa.Column(
45+
"string_array_field",
46+
postgresql.ARRAY(sa.VARCHAR()),
47+
autoincrement=False,
48+
nullable=False,
49+
),
50+
sa.Column("bool_field", sa.BOOLEAN(), autoincrement=False, nullable=False),
51+
sa.Column("file_name", sa.VARCHAR(), autoincrement=False, nullable=True),
52+
sa.PrimaryKeyConstraint("id", name="entities_pkey"),
4253
)
4354
# ### end Alembic commands ###

backend/migrations/versions/eff8a5a7fda3_change_resident_room_number_to_be_string.py

+16-12
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,33 @@
1010

1111

1212
# revision identifiers, used by Alembic.
13-
revision = 'eff8a5a7fda3'
14-
down_revision = '6ba7859cdf27'
13+
revision = "eff8a5a7fda3"
14+
down_revision = "6ba7859cdf27"
1515
branch_labels = None
1616
depends_on = None
1717

1818

1919
def upgrade():
2020
# ### commands auto generated by Alembic - please adjust! ###
21-
with op.batch_alter_table('residents', schema=None) as batch_op:
22-
batch_op.alter_column('room_num',
23-
existing_type=sa.INTEGER(),
24-
type_=sa.String(),
25-
existing_nullable=False)
21+
with op.batch_alter_table("residents", schema=None) as batch_op:
22+
batch_op.alter_column(
23+
"room_num",
24+
existing_type=sa.INTEGER(),
25+
type_=sa.String(),
26+
existing_nullable=False,
27+
)
2628

2729
# ### end Alembic commands ###
2830

2931

3032
def downgrade():
3133
# ### commands auto generated by Alembic - please adjust! ###
32-
with op.batch_alter_table('residents', schema=None) as batch_op:
33-
batch_op.alter_column('room_num',
34-
existing_type=sa.String(),
35-
type_=sa.INTEGER(),
36-
existing_nullable=False)
34+
with op.batch_alter_table("residents", schema=None) as batch_op:
35+
batch_op.alter_column(
36+
"room_num",
37+
existing_type=sa.String(),
38+
type_=sa.INTEGER(),
39+
existing_nullable=False,
40+
)
3741

3842
# ### end Alembic commands ###

frontend/src/components/common/Pagination.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Flex,
1010
Box,
1111
Text,
12-
Input
12+
Input,
1313
} from "@chakra-ui/react";
1414

1515
import {
@@ -42,14 +42,14 @@ const Pagination = ({
4242
const numPages = Math.ceil(Math.max(1, numRecords) / resultsPerPage);
4343

4444
const handleNumberInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
45-
const input = e.target.value as string
45+
const input = e.target.value as string;
4646

4747
if (input === "") {
48-
setUserPageNum(NaN)
49-
return
48+
setUserPageNum(NaN);
49+
return;
5050
}
5151

52-
const numericInput = input.replace(/[^0-9]/g, '');
52+
const numericInput = input.replace(/[^0-9]/g, "");
5353

5454
if (numericInput !== "") {
5555
const newUserPageNum = Number(numericInput);

frontend/src/components/forms/Signup.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ const Signup = ({
180180
setIsLoading(false);
181181
} else {
182182
const { requiresTwoFa, authUser } = registerResponse;
183-
console.log(requiresTwoFa, authUser)
184183
if (requiresTwoFa) {
185184
setToggle(!toggle);
186185
} else {

0 commit comments

Comments
 (0)