Skip to content

Commit

Permalink
Various config settings are no longer required in read_only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dullage authored and Gedulis12 committed Aug 7, 2023
1 parent ee328bc commit 3535978
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions flatnotes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,23 @@ def get_auth_type(self):

def get_username(self):
return self.get_env(
"FLATNOTES_USERNAME", mandatory=self.auth_type != AuthType.NONE
"FLATNOTES_USERNAME",
mandatory=self.auth_type
not in [AuthType.NONE, AuthType.READ_ONLY],
)

def get_password(self):
return self.get_env(
"FLATNOTES_PASSWORD", mandatory=self.auth_type != AuthType.NONE
"FLATNOTES_PASSWORD",
mandatory=self.auth_type
not in [AuthType.NONE, AuthType.READ_ONLY],
)

def get_session_key(self):
return self.get_env(
"FLATNOTES_SECRET_KEY", mandatory=self.auth_type != AuthType.NONE
"FLATNOTES_SECRET_KEY",
mandatory=self.auth_type
not in [AuthType.NONE, AuthType.READ_ONLY],
)

def get_session_expiry_days(self):
Expand Down

0 comments on commit 3535978

Please sign in to comment.