Skip to content

Commit 0145999

Browse files
committed
force csv export download, improved translations and migration
1 parent 69a4931 commit 0145999

File tree

7 files changed

+29
-58
lines changed

7 files changed

+29
-58
lines changed

django/gsmap/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def has_publish_permission(self, request):
272272

273273
def export_as_csv(self, request, queryset):
274274
response = HttpResponse(content_type="text/csv")
275-
# response['Content-Disposition'] = 'attachment; filename="export.csv"'
275+
response['Content-Disposition'] = 'attachment; filename="export.csv"'
276276
writer = csv.writer(response)
277277
writer.writerow(['no', 'created (UTC)', 'title', 'description', 'usergroup_type', 'usergroup', 'category_type', 'category', 'rating', 'workspace', 'public', 'email_hash', 'email_domain', 'geojson'])
278278

django/gsmap/migrations/0043_default_groups_and_permissions.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,17 @@ def apply_migration(apps, schema_editor):
3232
core_p_group.user_set.add(*users)
3333
core_a_group.user_set.add(*users)
3434

35-
# todo: Add non-existent standard categories and usergroups then assign to core groups
35+
Category = apps.get_model("gsmap", "Category")
36+
categories = Category.objects.using(db_alias).filter(group=None).all()
37+
for i, c in enumerate(categories):
38+
categories[i].group = default
39+
Category.objects.using(db_alias).bulk_update(categories, ["group"])
3640

37-
# todo: Add default group to objects without group
41+
Workspace = apps.get_model("gsmap", "Workspace")
42+
Workspace.objects.using(db_alias).filter(group=None).bulk_update(group=default)
3843

44+
Usergroup = apps.get_model("gsmap", "Usergroup")
45+
Usergroup.objects.using(db_alias).filter(group=None).bulk_update(group=default)
3946

4047
def revert_migration(apps, schema_editor):
4148
Group = apps.get_model("auth", "Group")
-176 Bytes
Binary file not shown.

django/locale/de/LC_MESSAGES/django.po

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: 0.7.4-b2\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2022-02-24 15:01+0000\n"
11+
"POT-Creation-Date: 2022-03-01 14:28+0000\n"
1212
"PO-Revision-Date: 2022-02-24 15:34+0200\n"
1313
"Last-Translator: Thorben Westerhuys <[email protected]>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -304,22 +304,6 @@ msgstr ""
304304
msgid "Back to the map"
305305
msgstr "Zurück zur Karte"
306306

307-
#: main/settings.py:158
308-
msgid "English"
309-
msgstr "Englisch"
310-
311-
#: main/settings.py:159
312-
msgid "German"
313-
msgstr "Deutsch"
314-
315-
#: main/settings.py:160
316-
msgid "French"
317-
msgstr "Französisch"
318-
319-
#: main/settings.py:161
320-
msgid "Italian"
321-
msgstr "Italienisch"
322-
323307
#: main/templates/admin/base.html:39
324308
msgid "Welcome,"
325309
msgstr "Willkommen,"
@@ -368,3 +352,15 @@ msgstr ""
368352
#: main/templates/registration/login.html:70
369353
msgid "Forgotten your password or username?"
370354
msgstr "Passwort oder Benutzername vergessen?"
355+
356+
#~ msgid "English"
357+
#~ msgstr "Englisch"
358+
359+
#~ msgid "German"
360+
#~ msgstr "Deutsch"
361+
362+
#~ msgid "French"
363+
#~ msgstr "Französisch"
364+
365+
#~ msgid "Italian"
366+
#~ msgstr "Italienisch"

django/locale/fr/LC_MESSAGES/django.po

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2022-02-24 15:01+0000\n"
11+
"POT-Creation-Date: 2022-03-01 14:28+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -269,22 +269,6 @@ msgstr ""
269269
msgid "Back to the map"
270270
msgstr ""
271271

272-
#: main/settings.py:158
273-
msgid "English"
274-
msgstr ""
275-
276-
#: main/settings.py:159
277-
msgid "German"
278-
msgstr ""
279-
280-
#: main/settings.py:160
281-
msgid "French"
282-
msgstr ""
283-
284-
#: main/settings.py:161
285-
msgid "Italian"
286-
msgstr ""
287-
288272
#: main/templates/admin/base.html:39
289273
msgid "Welcome,"
290274
msgstr ""

django/locale/it/LC_MESSAGES/django.po

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2022-02-24 15:01+0000\n"
11+
"POT-Creation-Date: 2022-03-01 14:28+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -269,22 +269,6 @@ msgstr ""
269269
msgid "Back to the map"
270270
msgstr ""
271271

272-
#: main/settings.py:158
273-
msgid "English"
274-
msgstr ""
275-
276-
#: main/settings.py:159
277-
msgid "German"
278-
msgstr ""
279-
280-
#: main/settings.py:160
281-
msgid "French"
282-
msgstr ""
283-
284-
#: main/settings.py:161
285-
msgid "Italian"
286-
msgstr ""
287-
288272
#: main/templates/admin/base.html:39
289273
msgid "Welcome,"
290274
msgstr ""

django/main/settings.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@
155155
LOCALE_PATHS = ( 'locale', )
156156

157157
LANGUAGES = [
158-
('en', _('English')),
159-
('de', _('German')),
160-
('fr', _('French')),
161-
('it', _('Italian')),
158+
('en', 'English'),
159+
('de', 'German'),
160+
('fr', 'French'),
161+
('it', 'Italian'),
162162
]
163163

164164
PARLER_LANGUAGES = {

0 commit comments

Comments
 (0)