-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨Ability to specify whether a user displays on login page (#397)
* Adding hide_user as an option * chore: 🧹 added db migration script * fix: 🚑 Added extra emby user policies * fix: 🚑 removed extra permissions and resorted to default values * fix: 🩹 made checkbox description more clear
- Loading branch information
Showing
8 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
apps/wizarr-backend/wizarr_backend/app/migrator/migrations/2024-04-30_16-44-17.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,32 @@ | ||
# | ||
# CREATED ON VERSION: V4.0.0 | ||
# MIGRATION: 2024-04-30_16-44-17 | ||
# CREATED: Tue Apr 30 2024 | ||
# | ||
|
||
from peewee import * | ||
from playhouse.migrate import * | ||
|
||
from app import db | ||
|
||
# Do not change the name of this file, | ||
# migrations are run in order of their filenames date and time | ||
|
||
def run(): | ||
# Use migrator to perform actions on the database | ||
migrator = SqliteMigrator(db) | ||
|
||
# Add new Column to users table, its a boolean field with a default value of True | ||
with db.transaction(): | ||
# Check if the column exists | ||
cursor = db.cursor() | ||
cursor.execute("PRAGMA table_info(invitations);") | ||
columns = cursor.fetchall() | ||
column_names = [column[1] for column in columns] | ||
|
||
if "hide_user" not in column_names: | ||
db.execute_sql("ALTER TABLE invitations ADD COLUMN hide_user INTEGER SET DEFAULT 1") | ||
else: | ||
print("Column hide_user already exists") | ||
|
||
print("Migration 2024-04-30_16-44-17 complete") |
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
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