-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove deprecated appuser handles in favor of workspace handles (#591)
* move handles from appuser to workspace (with fallback) * fix: routing logic for handle page * add handle<>workspace connection to admin pages * fix: use correct handle in views.py * pass down handle for /{handle} route * use workspace.handle or request.user.handle vs user.get_handle() * replace Handle.create_default_for_user with Handle.create_default_for_workspace * update set_default_handles script to set handle on team workspaces * remove handles from appuser model * remove AppUser.handle * only create workspace-handle when not anonymous * rename conflicting migration * update create_fixture script to export workspace.handle (and not user.handle) * add new fixture file without app_users.handle
- Loading branch information
Showing
15 changed files
with
93 additions
and
114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 5.1.3 on 2025-01-28 15:11 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app_users', '0024_alter_appuser_handle'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='appuser', | ||
name='handle', | ||
), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
from django.contrib import admin | ||
|
||
from app_users.admin import AppUserAdmin | ||
from workspaces.admin import WorkspaceAdmin | ||
from .models import Handle | ||
|
||
|
||
@admin.register(Handle) | ||
class HandleAdmin(admin.ModelAdmin): | ||
search_fields = ( | ||
["name", "redirect_url"] | ||
+ [f"user__{field}" for field in AppUserAdmin.search_fields] | ||
+ [f"workspace__{field}" for field in WorkspaceAdmin.search_fields] | ||
) | ||
readonly_fields = ["user", "workspace", "created_at", "updated_at"] | ||
search_fields = ["name", "redirect_url"] + [ | ||
f"workspace__{field}" for field in WorkspaceAdmin.search_fields | ||
] | ||
readonly_fields = ["workspace", "created_at", "updated_at"] | ||
|
||
list_filter = [ | ||
("user", admin.EmptyFieldListFilter), | ||
("workspace", admin.EmptyFieldListFilter), | ||
("redirect_url", admin.EmptyFieldListFilter), | ||
] |
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.