-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Registered users could delete files uploaded by anonymous users.
- Loading branch information
Ivan
committed
Mar 21, 2023
1 parent
d145603
commit dd6eacd
Showing
5 changed files
with
29 additions
and
5 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
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,10 +1,15 @@ | ||
from django import template | ||
|
||
from accounts.models import ProductBase, User | ||
from accounts.models import File, ProductBase, User | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.simple_tag | ||
def get_product_internal_info(product: ProductBase, user: User): | ||
return product.get_internal_info(user) | ||
|
||
|
||
@register.simple_tag | ||
def user_has_file_delete_permission(file: File, user: User): | ||
return file.has_delete_permission(user) |
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