-
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.
Fix url routing to serve 404 page instead of 403 when static page not…
… found - use blob.exists() to check if static file exists otherwise raise http exception 404 - avoid rendering a handle page with a sub-path (e.g. js/webflow.js) - Refactor `serve_static_file` to handle URLs more robustly - Replace custom exceptions with `HTTPException` in `render_recipe_page` and `url_shortener` functions - Extend `HandleAdmin` search fields with user fields and add filters
- Loading branch information
Showing
4 changed files
with
40 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
from django.contrib import admin | ||
|
||
from app_users.admin import AppUserAdmin | ||
from .models import Handle | ||
|
||
|
||
@admin.register(Handle) | ||
class HandleAdmin(admin.ModelAdmin): | ||
search_fields = ["name", "redirect_url"] | ||
search_fields = ["name", "redirect_url"] + [ | ||
f"user__{field}" for field in AppUserAdmin.search_fields | ||
] | ||
readonly_fields = ["user", "created_at", "updated_at"] | ||
|
||
list_filter = [ | ||
("user", 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