mirror of
https://github.com/lemeow125/Borrowing-TrackerBackend.git
synced 2025-04-27 10:11:24 +08:00
Improved transaction and breakage report serializers when handling breakages
This commit is contained in:
parent
d0ca68149a
commit
0b1c065a80
4 changed files with 47 additions and 40 deletions
|
@ -4,6 +4,8 @@ from accounts.models import CustomUser
|
|||
|
||||
|
||||
class TransactionAdmin(admin.ModelAdmin):
|
||||
list_display = ('id', 'borrower', 'teacher', 'transaction_status')
|
||||
|
||||
def formfield_for_foreignkey(self, db_field, request, **kwargs):
|
||||
if db_field.name == "borrower":
|
||||
kwargs["queryset"] = CustomUser.objects.exclude(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue