|
|
|
@ -19,10 +19,24 @@ class ShiftAdmin(admin.ModelAdmin):
|
|
|
|
|
return object.room.required_helpers - object.shiftregistration_set.count()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# admin.site.register(Shift)
|
|
|
|
|
def send_login(modeladmin, request, queryset):
|
|
|
|
|
for helper in queryset:
|
|
|
|
|
helper.send_confirmation()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RegistationInline(admin.TabularInline):
|
|
|
|
|
model = ShiftRegistration
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@admin.register(Helper)
|
|
|
|
|
class HelperAdmin(admin.ModelAdmin):
|
|
|
|
|
readonly_fields = ("phone",)
|
|
|
|
|
fields = ("name", "phone", "number_validated")
|
|
|
|
|
list_display = ("name",)
|
|
|
|
|
inlines = (RegistationInline,)
|
|
|
|
|
actions = (send_login,)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin.site.register(Helper)
|
|
|
|
|
admin.site.register(ShiftRegistration)
|
|
|
|
|
admin.site.register(Message)
|
|
|
|
|
admin.site.register(LoginToken)
|
|
|
|
|