Skip to content

Commit

Permalink
Fix crash when MATRIX_HOMESERVER_URL not set in environment
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-russell committed Feb 22, 2024
1 parent 57aea72 commit ca284e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fractal_database_matrix/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async def accept_invite(self, room_id: str, target: "MatrixReplicationTarget"):


class InMemoryMatrixCredentials(MatrixCredentials):
homeserver = os.environ["MATRIX_HOMESERVER_URL"]
homeserver: str = ""

class Meta:
proxy = True
Expand All @@ -53,6 +53,7 @@ def get_creds(self) -> Union[MatrixCredentials, InMemoryMatrixCredentials]:
else:
try:
return InMemoryMatrixCredentials(
homeserver=os.environ["MATRIX_HOMESERVER_URL"],
matrix_id=os.environ["MATRIX_USER_ID"],
access_token=os.environ["MATRIX_ACCESS_TOKEN"],
)
Expand Down

0 comments on commit ca284e6

Please sign in to comment.