Skip to content

Commit c478a2a

Browse files
Merge branch 'main' into modal
2 parents 4e45693 + 68cde75 commit c478a2a

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

docs/deployment.qmd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ doctl databases firewalls append <database-cluster-id> --rule <type>:<value>
6969

7070
where `<type>` is `ip_addr` and `<value>` is the IP address of the application server. See the [DigitalOcean documentation](https://docs.digitalocean.com/reference/doctl/reference/databases/firewalls/append/) for more details.
7171

72-
**Note:** You can only complete this step after you have deployed your application layer and obtained the IP address of the application server.
72+
**Note:** You can only complete this step after you have deployed your application layer and obtained a static IP address for the application server.
7373

7474
## Deploying and Configuring the FastAPI App
7575

@@ -80,8 +80,9 @@ The big advantages of deploying on Modal.com are:
8080
2. that it's a very user-friendly platform.
8181

8282
The disadvantages are:
83-
1. that Modal is a Python-only platform and cannot run the database layer, so you'll have to deploy that somewhere else, and
84-
2. that you'll need to make some modest changes to the codebase to get it to work on Modal.
83+
1. that Modal is a Python-only platform and cannot run the database layer, so you'll have to deploy that somewhere else,
84+
2. that you'll need to make some modest changes to the codebase to get it to work on Modal, and
85+
3. that Modal offers a [static IP address for the application server](https://modal.com/docs/guide/proxy-ips) only if you pay for a higher-tier plan starting at $250/year, which makes securing the database layer with a firewall rule cost prohibitive.
8586

8687
#### Getting Started
8788

routers/organization.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,6 @@ def invite_member(
232232

233233
if not organization:
234234
raise OrganizationNotFoundError()
235-
236-
# Log organization and roles state
237-
org_identity = session.identity_key(instance=organization)
238-
role_info = [(r.id, r.name, session.identity_key(instance=r)) for r in organization.roles]
239235

240236
# Find the account and associated user by email
241237
account = session.exec(
@@ -250,7 +246,6 @@ def invite_member(
250246
raise UserNotFoundError()
251247

252248
invited_user = account.user
253-
user_identity = session.identity_key(instance=invited_user)
254249

255250
# Check if user is already a member of this organization
256251
is_already_member = False

tests/utils/test_auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_password_pattern() -> None:
123123
password += random.choice(required_elements[other_element])
124124
# Randomize the order of the characters in the string
125125
password = ''.join(random.sample(password, len(password)))
126-
assert re.match(COMPILED_PASSWORD_PATTERN, password) is not None, f"Password {password} does not match the pattern"
126+
assert re.match(COMPILED_PASSWORD_PATTERN, password) is not None, f"Password {password} does not match the pattern"
127127

128128
# Invalid password tests
129129

@@ -213,7 +213,7 @@ def test_send_email_update_confirmation(mock_send: MagicMock) -> None:
213213

214214
# Test existing token case
215215
session.reset_mock()
216-
session.exec.return_value.first.return_value = EmailUpdateToken() # Existing token
216+
session.exec.return_value.first.return_value = EmailUpdateToken(account_id=account_id)
217217

218218
send_email_update_confirmation(current_email, new_email, account_id, session)
219219

0 commit comments

Comments
 (0)