Add Event user registration
This commit is contained in:
20
rog/admin.py
20
rog/admin.py
@ -29,6 +29,24 @@ from django.core.exceptions import ValidationError
|
||||
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from .services.csv_processor import EntryCSVProcessor
|
||||
|
||||
@admin.register(Entry)
|
||||
class EntryAdmin(admin.ModelAdmin):
|
||||
list_display = ['team', 'event', 'category', 'date', 'is_active']
|
||||
|
||||
def get_urls(self):
|
||||
from django.urls import path
|
||||
urls = super().get_urls()
|
||||
custom_urls = [
|
||||
path('upload-csv/', self.upload_csv_view, name='entry_upload_csv'),
|
||||
]
|
||||
return custom_urls + urls
|
||||
|
||||
def upload_csv_view(self, request):
|
||||
processor = EntryCSVProcessor()
|
||||
return processor.process_upload(request)
|
||||
|
||||
@admin.register(GifurogeRegister)
|
||||
class GifurogeRegisterAdmin(admin.ModelAdmin):
|
||||
list_display = ('event_code', 'time', 'owner_name', 'email', 'team_name', 'department')
|
||||
@ -912,7 +930,7 @@ class CustomUserAdmin(UserAdmin):
|
||||
#model = CustomUser
|
||||
|
||||
list_display = ('email', 'is_staff', 'is_active', 'is_rogaining', 'zekken_number', 'event_code', 'team_name', 'group', 'firstname', 'lastname')
|
||||
search_fields = ('email', 'firstname', 'lastname', 'zekken_number')
|
||||
search_fields = ('egit mail', 'firstname', 'lastname', 'zekken_number')
|
||||
list_filter = ('is_staff', 'is_active', 'is_rogaining', 'group')
|
||||
ordering = ('email',)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user