Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export af forenings info indeholder nu også email for foreningerne #1162

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ test-screens
members.db
*.bak
.vs/
test-files

# MacOS temp file
.DS_Store
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
command: "${SERVER_COMMAND} 0.0.0.0:${PORT}"
volumes:
- .:/app
- ./test-files:/app/test-files
ports:
- "${PORT}:${PORT}"
depends_on:
Expand Down Expand Up @@ -60,6 +61,8 @@ services:
- webnet
ports:
- "4444:4444"
volumes:
- ./test-files:/app/test-files

volumes:
database:
Expand Down
16 changes: 14 additions & 2 deletions members/admin/union_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,17 @@ class UnionAdmin(admin.ModelAdmin):
"founded_at",
"closed_at",
)
search_fields = ("name",)
search_fields = (
"name",
"email",
"address__streetname",
"address__housenumber",
"address__placename",
"address__zipcode",
"address__city",
)
search_help_text = "Du kan søge på forening (navn, adresse, email)"

filter_horizontal = ["board_members"]
raw_id_fields = ("chairman", "second_chair", "cashier", "secretary")

Expand Down Expand Up @@ -218,7 +228,7 @@ def waitinglist_count_link(self, item):
waitinglist_count_link.admin_order_field = "waitinglist_count"

def export_csv_union_info(self, request, queryset):
result_string = "Forening;Oprettelsdato;Lukkedato;"
result_string = "Forening;Email;Oprettelsdato;Lukkedato;"
result_string += "formand-navn;formand-email;formand-tlf;"
result_string += "næstformand-navn;næstformand-email;næstformand-tlf;"
result_string += "kasserer-navn;kasserer-email;kasserer-tlf;"
Expand All @@ -227,6 +237,8 @@ def export_csv_union_info(self, request, queryset):
for union in queryset:
result_string += union.name
result_string += ";"
result_string += union.email
result_string += ";"
if union.founded_at is not None:
result_string += union.founded_at.strftime("%Y-%m-%d")
result_string += ";"
Expand Down
Loading
Loading