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)
|
@admin.register(Room)
|
||||||
class RoomAdmin(admin.ModelAdmin):
|
class RoomAdmin(admin.ModelAdmin):
|
||||||
list_display = ("name", "description_length", "shift_count")
|
list_display = ("name", "description_length", "shift_count", "required_helpers")
|
||||||
inlines = [ShiftInline]
|
inlines = [ShiftInline]
|
||||||
|
|
||||||
def description_length(self, object):
|
def description_length(self, object):
|
||||||
|
|
|
@ -89,9 +89,7 @@ def import_calendar(calendar):
|
||||||
rooms[r.name] = r
|
rooms[r.name] = r
|
||||||
for room, r in rooms.items():
|
for room, r in rooms.items():
|
||||||
if r == None:
|
if r == None:
|
||||||
rooms[room] = Room(
|
rooms[room] = Room(name=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].save()
|
rooms[room].save()
|
||||||
|
|
||||||
for e in Event.objects.filter(calendar=calendar, uuid__in=events):
|
for e in Event.objects.filter(calendar=calendar, uuid__in=events):
|
||||||
|
|
Loading…
Reference in New Issue