change default required helpers to 1, even in import, so locations can be changed
This commit is contained in:
parent
ce8316a69c
commit
04d85811fe
|
@ -20,7 +20,7 @@ class ShiftInline(admin.TabularInline):
|
|||
|
||||
@admin.register(Room)
|
||||
class RoomAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "description_length", "shift_count")
|
||||
list_display = ("name", "description_length", "shift_count", "required_helpers")
|
||||
inlines = [ShiftInline]
|
||||
|
||||
def description_length(self, object):
|
||||
|
|
|
@ -89,9 +89,7 @@ def import_calendar(calendar):
|
|||
rooms[r.name] = r
|
||||
for room, r in rooms.items():
|
||||
if r == None:
|
||||
rooms[room] = Room(
|
||||
name=room, required_helpers=0
|
||||
) # required_helpers=0 ensures a shift in a new room is not displayed unless the correct number of required helpers is set or the shift itself specifies it
|
||||
rooms[room] = Room(name=room)
|
||||
rooms[room].save()
|
||||
|
||||
for e in Event.objects.filter(calendar=calendar, uuid__in=events):
|
||||
|
|
Loading…
Reference in New Issue