-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User store extended settings store (#828)
* ➕ Extend subscriber model with additional settings * ➕ Extend user store with additional settings * 🔨 Move settings related functions from utils * 🔨 Replace deprecated exists function with authenticated * 🔨 Use init call for whole user store * 🔨 Load default locale from user settings * 🔨 Only update settings on settings page * 🔨 Fix user store tests * 🔨 Fix user store tests (2nd try) * 📜 Update documentation * Update backend/src/appointment/database/models.py Co-authored-by: Mel <97147377+MelissaAutumn@users.noreply.github.com> * Update backend/src/appointment/database/models.py Co-authored-by: Mel <97147377+MelissaAutumn@users.noreply.github.com> * Update backend/src/appointment/database/schemas.py Co-authored-by: Mel <97147377+MelissaAutumn@users.noreply.github.com> * Update backend/src/appointment/migrations/versions/2025_01_15_1340-4a15d01919b8_add_config_fields_to_subscribers_table.py Co-authored-by: Mel <97147377+MelissaAutumn@users.noreply.github.com> * Update backend/src/appointment/migrations/versions/2025_01_15_1340-4a15d01919b8_add_config_fields_to_subscribers_table.py Co-authored-by: Mel <97147377+MelissaAutumn@users.noreply.github.com> * Update backend/src/appointment/routes/api.py Co-authored-by: Mel <97147377+MelissaAutumn@users.noreply.github.com> * Update backend/src/appointment/routes/auth.py Co-authored-by: Mel <97147377+MelissaAutumn@users.noreply.github.com> * Update docs/README.md Co-authored-by: Mel <97147377+MelissaAutumn@users.noreply.github.com> * 🔨 Fix more colour naming * 🔨 Fix more colour naming --------- Co-authored-by: Mel <97147377+MelissaAutumn@users.noreply.github.com>
- Loading branch information
1 parent
f0f5b10
commit dc7376a
Showing
35 changed files
with
373 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...igrations/versions/2025_01_15_1340-4a15d01919b8_add_config_fields_to_subscribers_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Add config fields to subscribers table | ||
Revision ID: 4a15d01919b8 | ||
Revises: 0c99f6a02f3b | ||
Create Date: 2025-01-15 13:40:12.022117 | ||
""" | ||
import os | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy_utils import StringEncryptedType | ||
from sqlalchemy_utils.types.encrypted.encrypted_type import AesEngine | ||
from appointment.database.models import ColourScheme, TimeMode | ||
|
||
|
||
def secret(): | ||
return os.getenv('DB_SECRET') | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '4a15d01919b8' | ||
down_revision = '0c99f6a02f3b' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.add_column('subscribers', sa.Column('colour_scheme', sa.Enum(ColourScheme), default=ColourScheme.system, nullable=False, index=True)) | ||
op.add_column('subscribers', sa.Column('time_mode', sa.Enum(TimeMode), default=TimeMode.h24, nullable=False, index=True)) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_column('subscribers', 'colour_scheme') | ||
op.drop_column('subscribers', 'time_mode') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.