Skip to content

Commit

Permalink
Add 0016_show_event_insertion_datetime_in_admin.patch to show missing…
Browse files Browse the repository at this point in the history
… datetime field in the admin panel
  • Loading branch information
francesco-ballarin committed Aug 17, 2024
1 parent 5ee9d7d commit 3e3ad68
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions patches/turing/0016_show_event_insertion_datetime_in_admin.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/engine/admin.py b/engine/admin.py
index 84dbdc1..9575d17 100644
--- a/engine/admin.py
+++ b/engine/admin.py
@@ -6,11 +6,15 @@ from django.contrib.auth.admin import UserAdmin
# Register your models here.
admin.site.register(Gara)
admin.site.register(Squadra)
-admin.site.register(Evento, SimpleHistoryAdmin)
-admin.site.register(Consegna, SimpleHistoryAdmin)
-admin.site.register(Jolly)
admin.site.register(Soluzione)

+class EventAdmin(SimpleHistoryAdmin):
+ readonly_fields = ('orario',)
+
+admin.site.register(Consegna, EventAdmin)
+admin.site.register(Jolly, EventAdmin)
+admin.site.register(Bonus, EventAdmin)
+
class MyUserAdmin(UserAdmin):
list_display = ('username', 'email', 'first_name', 'last_name', 'gender', 'is_staff')
fieldsets = (
1 change: 1 addition & 0 deletions patches/turing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ This directory contains a few local patches. Most of them are related to changes
13. `0013_display_protocol_numbers.patch`: display the protocol number (primary key in the database) and the insertion date when adding a new answer or jolly selection through the web interface.
14. `0014_classification_time_from_server.patch`: stop using `Date.now()` in the calculation of the classification and use the server datetime instead, since the browser date may not agree with the one on the server.
15. `0015_manual_bonus.patch`: add feature to assign (positive or negative) bonus to a team. As a side effect, for simplicity of the implementation of the new feature the commentary has been disabled.
16. `0016_show_event_insertion_datetime_in_admin.patch`: show date and time of the creation of an event in the admin panel.
1 change: 1 addition & 0 deletions patches/turing/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ else
apply_patch 0013_display_protocol_numbers.patch
apply_patch 0014_classification_time_from_server.patch
apply_patch 0015_manual_bonus.patch
apply_patch 0016_show_event_insertion_datetime_in_admin.patch
fi

0 comments on commit 3e3ad68

Please sign in to comment.