1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-02-27 02:16:31 +00:00

Compare commits

..

No commits in common. "f3a3f07e388da157a22b666b6e16722229e5cce0" and "540f3bc354eb1ef6b7afbbe9cb55ba6edfd0885e" have entirely different histories.

5 changed files with 12 additions and 37 deletions

View File

@ -11,7 +11,6 @@ from member.models import Membership
from note_kfet.middlewares import get_current_request from note_kfet.middlewares import get_current_request
from permission.backends import PermissionBackend from permission.backends import PermissionBackend
from rest_framework.utils import model_meta from rest_framework.utils import model_meta
from rest_framework.validators import UniqueTogetherValidator
from ..models.notes import Note, NoteClub, NoteSpecial, NoteUser, Alias, Trust from ..models.notes import Note, NoteClub, NoteSpecial, NoteUser, Alias, Trust
from ..models.transactions import TransactionTemplate, Transaction, MembershipTransaction, TemplateCategory, \ from ..models.transactions import TransactionTemplate, Transaction, MembershipTransaction, TemplateCategory, \
@ -87,9 +86,11 @@ class TrustSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = Trust model = Trust
fields = '__all__' fields = '__all__'
validators = [UniqueTogetherValidator(
queryset=Trust.objects.all(), fields=('trusting', 'trusted'), def validate(self, attrs):
message=_("This friendship already exists"))] instance = Trust(**attrs)
instance.clean()
return attrs
class AliasSerializer(serializers.ModelSerializer): class AliasSerializer(serializers.ModelSerializer):

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-18 17:27+0200\n" "POT-Creation-Date: 2023-09-01 18:01+0200\n"
"PO-Revision-Date: 2020-11-16 20:02+0000\n" "PO-Revision-Date: 2020-11-16 20:02+0000\n"
"Last-Translator: bleizi <bleizi@crans.org>\n" "Last-Translator: bleizi <bleizi@crans.org>\n"
"Language-Team: German <http://translate.ynerant.fr/projects/nk20/nk20/de/>\n" "Language-Team: German <http://translate.ynerant.fr/projects/nk20/nk20/de/>\n"
@ -1300,13 +1300,7 @@ msgstr "Empfänger"
msgid "amount" msgid "amount"
msgstr "Anzahl" msgstr "Anzahl"
#: apps/note/api/serializers.py:92 #: apps/note/api/serializers.py:199 apps/note/api/serializers.py:205
#, fuzzy
#| msgid "This credit is already validated."
msgid "This friendship already exists"
msgstr "Dieser Kredit ist bereits validiert."
#: apps/note/api/serializers.py:198 apps/note/api/serializers.py:204
#: apps/note/models/transactions.py:228 #: apps/note/models/transactions.py:228
msgid "" msgid ""
"The transaction can't be saved since the source note or the destination note " "The transaction can't be saved since the source note or the destination note "

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-18 17:27+0200\n" "POT-Creation-Date: 2023-09-01 18:01+0200\n"
"PO-Revision-Date: 2022-04-11 23:12+0200\n" "PO-Revision-Date: 2022-04-11 23:12+0200\n"
"Last-Translator: bleizi <bleizi@crans.org>\n" "Last-Translator: bleizi <bleizi@crans.org>\n"
"Language-Team: \n" "Language-Team: \n"
@ -1286,13 +1286,7 @@ msgstr "destino"
msgid "amount" msgid "amount"
msgstr "monto" msgstr "monto"
#: apps/note/api/serializers.py:92 #: apps/note/api/serializers.py:199 apps/note/api/serializers.py:205
#, fuzzy
#| msgid "This credit is already validated."
msgid "This friendship already exists"
msgstr "Este crédito ya fue validado."
#: apps/note/api/serializers.py:198 apps/note/api/serializers.py:204
#: apps/note/models/transactions.py:228 #: apps/note/models/transactions.py:228
msgid "" msgid ""
"The transaction can't be saved since the source note or the destination note " "The transaction can't be saved since the source note or the destination note "
@ -3579,11 +3573,6 @@ msgstr ""
"pagar su afiliación. Tambien tiene que validar su correo electronico con el " "pagar su afiliación. Tambien tiene que validar su correo electronico con el "
"enlace que recibió." "enlace que recibió."
#, fuzzy
#~| msgid "People having you as a friend"
#~ msgid "You already have that person as a friend"
#~ msgstr "Personas que tienen usted como amig@"
#~ msgid "" #~ msgid ""
#~ "I declare that I opened or I will open soon a bank account in the Société " #~ "I declare that I opened or I will open soon a bank account in the Société "
#~ "générale with the BDE partnership." #~ "générale with the BDE partnership."

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-18 17:27+0200\n" "POT-Creation-Date: 2023-09-01 18:01+0200\n"
"PO-Revision-Date: 2022-04-11 22:05+0200\n" "PO-Revision-Date: 2022-04-11 22:05+0200\n"
"Last-Translator: bleizi <bleizi@crans.org>\n" "Last-Translator: bleizi <bleizi@crans.org>\n"
"Language-Team: French <http://translate.ynerant.fr/projects/nk20/nk20/fr/>\n" "Language-Team: French <http://translate.ynerant.fr/projects/nk20/nk20/fr/>\n"
@ -1288,11 +1288,7 @@ msgstr "destination"
msgid "amount" msgid "amount"
msgstr "montant" msgstr "montant"
#: apps/note/api/serializers.py:92 #: apps/note/api/serializers.py:199 apps/note/api/serializers.py:205
msgid "This friendship already exists"
msgstr "Cette amitié existe déjà"
#: apps/note/api/serializers.py:198 apps/note/api/serializers.py:204
#: apps/note/models/transactions.py:228 #: apps/note/models/transactions.py:228
msgid "" msgid ""
"The transaction can't be saved since the source note or the destination note " "The transaction can't be saved since the source note or the destination note "
@ -3604,11 +3600,6 @@ msgstr ""
"d'adhésion. Vous devez également valider votre adresse email en suivant le " "d'adhésion. Vous devez également valider votre adresse email en suivant le "
"lien que vous avez reçu." "lien que vous avez reçu."
#, fuzzy
#~| msgid "People having you as a friend"
#~ msgid "You already have that person as a friend"
#~ msgstr "Personnes vous ayant ajouté"
#~ msgid "" #~ msgid ""
#~ "I declare that I opened or I will open soon a bank account in the Société " #~ "I declare that I opened or I will open soon a bank account in the Société "
#~ "générale with the BDE partnership." #~ "générale with the BDE partnership."

View File

@ -27,7 +27,7 @@ msgstr "Alias supprimé avec succès"
#: apps/member/static/member/js/trust.js:14 #: apps/member/static/member/js/trust.js:14
msgid "You can't add yourself as a friend" msgid "You can't add yourself as a friend"
msgstr "Vous ne pouvez pas vous ajouter vous-même en ami" msgstr ""
#: apps/member/static/member/js/trust.js:37 #: apps/member/static/member/js/trust.js:37
msgid "Friendship successfully added" msgid "Friendship successfully added"