Fix Postgres error

This commit is contained in:
2025-08-31 10:01:42 +09:00
parent 0ef0bde5b1
commit 71b073229e
3 changed files with 71 additions and 5 deletions

View File

@ -743,7 +743,7 @@ class LocationAdmin(LeafletGeoAdmin):
search_fields = ('location_id', 'cp', 'location_name', 'category', 'event_name','group',)
list_filter = ('event_name', 'group',)
ordering = ('location_id', 'cp',)
list_display = ('location_id','sub_loc_id', 'cp', 'location_name', 'photos', 'category', 'group', 'event_name', 'event_active', 'auto_checkin', 'checkin_radius', 'checkin_point', 'buy_point',)
list_display = ('location_id','sub_loc_id', 'cp', 'location_name', 'photos', 'category', 'group', 'event_name', 'auto_checkin', 'checkin_radius', 'checkin_point', 'buy_point',)
def tranfer_to_location(modeladmin, request, queryset):
@ -848,7 +848,7 @@ class TempLocationAdmin(LeafletGeoAdmin):
search_fields = ('location_id', 'cp', 'location_name', 'category', 'event_name',)
list_filter = ('category', 'event_name',)
ordering = ('location_id', 'cp',)
list_display = ('location_id','cp', 'location_name', 'category', 'event_name', 'event_active', 'auto_checkin', 'checkin_radius', 'checkin_point', 'buy_point',)
list_display = ('location_id','cp', 'location_name', 'category', 'event_name', 'auto_checkin', 'checkin_radius', 'checkin_point', 'buy_point',)
actions = [tranfer_to_location,]
@ -1158,8 +1158,11 @@ class Location2025Admin(LeafletGeoAdmin):
# フォーム表示 - Location2025システム用
from .models import NewEvent2
# statusフィールドベースでアクティブなイベントを取得
events = NewEvent2.objects.filter(status='public').order_by('-start_datetime')
# スタッフユーザーの場合は全ステータスのイベントを表示
if request.user.is_staff:
events = NewEvent2.objects.all().order_by('-start_datetime')
else:
events = NewEvent2.objects.filter(status='public').order_by('-start_datetime')
return render(request, 'admin/location2025/upload_csv.html', {
'events': events,