Skip to content

Commit

Permalink
Fixes several things and clean up after merge.
Browse files Browse the repository at this point in the history
- Fix teardown in client fixture not working (ForeignKey error).
- Adjust view `download_general_file` to work with the new SearchableFile
  • Loading branch information
cyrillkuettel committed Jul 10, 2024
1 parent 57633f4 commit ab15cce
Show file tree
Hide file tree
Showing 22 changed files with 834 additions and 89 deletions.
2 changes: 1 addition & 1 deletion src/privatim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def profile_pic(request: 'IRequest') -> str:
user = request.user
if not user:
return ''
return request.route_url('download_general_file', id=user.picture.id)
return request.route_url('download_file', id=user.picture.id)

config.add_request_method(profile_pic, 'profile_pic', property=True)
config.add_request_method(MessageQueue, 'messages', reify=True)
Expand Down
7 changes: 5 additions & 2 deletions src/privatim/forms/fields/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,12 @@ class SearchableSelectField(SelectMultipleField):
Note: you need to call form.raw_data() to actually get the choices as list
"""

def __call__(self, *args: Any, **kwargs: Any) -> Any:
widget = ChosenSelectWidget(multiple=True)

def __call__(self, **kwargs: Any) -> Any:
init_tom_select.need()
return super().__call__(*args, **kwargs)
self.data: list[str] = []
return super().__call__(**kwargs)

def process_data(self, value: list[object]) -> None:
if value:
Expand Down
2 changes: 1 addition & 1 deletion src/privatim/forms/filter_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_date_fields(self) -> list[tuple[str, DateField]]:
return [('datumVon', self.start_date), ('datumBis', self.end_date)]

canton: SelectField = SelectField(
_('Kanton'),
_('Canton'),
choices=[('all', _('all'))] + cantons_named,
validators=[Optional()],
render_kw={'class': 'form-select', 'id': 'kanton'},
Expand Down
Binary file added src/privatim/locale/de/LC_MESSAGES/privatim.mo
Binary file not shown.
45 changes: 34 additions & 11 deletions src/privatim/locale/de/LC_MESSAGES/privatim.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE 1.0\n"
"POT-Creation-Date: 2024-07-10 01:22+0200\n"
"POT-Creation-Date: 2024-07-10 10:22+0200\n"
"PO-Revision-Date: 2024-05-21 21:20+0200\n"
"Last-Translator: cyrill <[email protected]>\n"
"Language-Team: German <[email protected]>\n"
Expand Down Expand Up @@ -335,6 +335,11 @@ msgstr "Beschreibung:"
msgid "Recommendation:"
msgstr "Empfehlung:"

#: src/privatim/views/templates/consultation.pt
#: src/privatim/forms/add_comment.py
msgid "Add Comment"
msgstr "Kommentar hinzufügen"

#: src/privatim/views/templates/consultation.pt
#: src/privatim/forms/consultation_form.py
msgid "Documents"
Expand All @@ -345,11 +350,6 @@ msgstr "Dokumente"
msgid "Status"
msgstr "Status"

#: src/privatim/views/templates/consultation.pt
#: src/privatim/forms/add_comment.py
msgid "Add Comment"
msgstr "Kommentar hinzufügen"

#: src/privatim/views/templates/search_results.pt
msgid "Search Results"
msgstr "Suchergebnisse"
Expand Down Expand Up @@ -392,17 +392,21 @@ msgstr "Gremium:"
msgid "Show Meeting"
msgstr "Sitzung anzeigen"

#: src/privatim/views/templates/activities.pt
#: src/privatim/views/templates/activities.pt src/privatim/forms/filter_form.py
msgid "Meeting"
msgstr "Sitzung"

#: src/privatim/views/templates/activities.pt
#: src/privatim/views/templates/activities.pt src/privatim/forms/filter_form.py
msgid "Consultation"
msgstr "Vernehmlassung"

#: src/privatim/views/templates/activities.pt
msgid "Choose..."
msgstr "Auswählen..."
msgid "Type"
msgstr "Art"

#: src/privatim/views/templates/activities.pt src/privatim/forms/filter_form.py
msgid "Filter"
msgstr "Filter"

#: src/privatim/views/templates/login.pt
msgid "Sign in"
Expand Down Expand Up @@ -590,7 +594,7 @@ msgstr "Beschluss"
msgid "Cantons"
msgstr "Kantone"

#: src/privatim/forms/add_comment.py
#: src/privatim/forms/add_comment.py src/privatim/forms/filter_form.py
msgid "Comment"
msgstr "Kommentar"

Expand All @@ -617,6 +621,22 @@ msgstr "Dieses Feld ist deaktiviert."
msgid "This field is read only."
msgstr "Dieses Feld ist schreibgeschützt."

#: src/privatim/forms/filter_form.py
msgid "Canton"
msgstr "Kanton"

#: src/privatim/forms/filter_form.py
msgid "all"
msgstr "Alle"

#: src/privatim/forms/filter_form.py
msgid "Date from"
msgstr "Datum von"

#: src/privatim/forms/filter_form.py
msgid "Date to"
msgstr "Datum bis"

#: src/privatim/forms/meeting_form.py
msgid "Edit meeting"
msgstr "Sitzung bearbeiten"
Expand Down Expand Up @@ -691,3 +711,6 @@ msgstr "Protokoll der Sitzung ${title}"
#: src/privatim/reporting/template/report.pt
msgid "Attendees:"
msgstr "Teilnehmende:"

#~ msgid "Kanton"
#~ msgstr "Canton"
Binary file added src/privatim/locale/fr/LC_MESSAGES/privatim.mo
Binary file not shown.
44 changes: 26 additions & 18 deletions src/privatim/locale/fr/LC_MESSAGES/privatim.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE 1.0\n"
"POT-Creation-Date: 2024-07-10 01:22+0200\n"
"POT-Creation-Date: 2024-07-10 10:22+0200\n"
"PO-Revision-Date: 2024-04-11 15:53+0200\n"
"Last-Translator: cyrill <[email protected]>\n"
"Language-Team: French <[email protected]>\n"
Expand Down Expand Up @@ -349,11 +349,6 @@ msgstr "Documents"
msgid "Status"
msgstr "Statut"

#: src/privatim/views/templates/consultation.pt
#: src/privatim/forms/add_comment.py
msgid "Add Comment"
msgstr "Ajouter un commentaire"

#: src/privatim/views/templates/search_results.pt
msgid "Search Results"
msgstr "Résultats de la recherche"
Expand All @@ -375,7 +370,6 @@ msgstr "Correspondance de fichier"
msgid "File Content"
msgstr "Contenu du fichier"


#: src/privatim/views/templates/password_change.pt
msgid "Change Password"
msgstr "Changer le mot de passe"
Expand All @@ -396,17 +390,21 @@ msgstr "Comité:"
msgid "Show Meeting"
msgstr "Afficher la réunion"

#: src/privatim/views/templates/activities.pt
#: src/privatim/views/templates/activities.pt src/privatim/forms/filter_form.py
msgid "Meeting"
msgstr "Réunion"

#: src/privatim/views/templates/activities.pt
#: src/privatim/views/templates/activities.pt src/privatim/forms/filter_form.py
msgid "Consultation"
msgstr "Consultation"

#: src/privatim/views/templates/activities.pt
msgid "Choose..."
msgstr "Choisir..."
msgid "Type"
msgstr "Variété"

#: src/privatim/views/templates/activities.pt src/privatim/forms/filter_form.py
msgid "Filter"
msgstr "Filtre"

#: src/privatim/views/templates/login.pt
msgid "Sign in"
Expand Down Expand Up @@ -594,7 +592,7 @@ msgstr "Décision"
msgid "Cantons"
msgstr "Les cantons"

#: src/privatim/forms/add_comment.py
#: src/privatim/forms/add_comment.py src/privatim/forms/filter_form.py
msgid "Comment"
msgstr "Commentaire"

Expand All @@ -619,6 +617,22 @@ msgstr "Ce champ est désactivé."
msgid "This field is read only."
msgstr "Ce champ est en lecture seule."

#: src/privatim/forms/filter_form.py
msgid "Canton"
msgstr "Canton"

#: src/privatim/forms/filter_form.py
msgid "all"
msgstr "tous"

#: src/privatim/forms/filter_form.py
msgid "Date from"
msgstr "Date de"

#: src/privatim/forms/filter_form.py
msgid "Date to"
msgstr "Date à"

#: src/privatim/forms/meeting_form.py
msgid "Edit meeting"
msgstr "Modifier la réunion"
Expand Down Expand Up @@ -691,9 +705,3 @@ msgstr "Procès-verbal de la réunion ${title}"
#: src/privatim/reporting/template/report.pt
msgid "Attendees:"
msgstr "Participants:"

#~ msgid "Unbekannter Ersteller"
#~ msgstr "Créateur inconnu"

#~ msgid "Search..."
#~ msgstr "Recherche"
Loading

0 comments on commit ab15cce

Please sign in to comment.