Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NoteKfet 2020
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BDE
NoteKfet 2020
Commits
fb8e6caf
Verified
Commit
fb8e6caf
authored
Jul 24, 2019
by
erdnaxe
🎇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement clean methode for Note
parent
32a37eae
Pipeline
#1370
passed with stage
in 2 minutes and 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
36 deletions
+67
-36
note/locale/fr/LC_MESSAGES/django.po
note/locale/fr/LC_MESSAGES/django.po
+51
-31
note/models/notes.py
note/models/notes.py
+16
-5
No files found.
note/locale/fr/LC_MESSAGES/django.po
View file @
fb8e6caf
...
...
@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-07-
17 13:48
+0200\n"
"POT-Creation-Date: 2019-07-
24 22:37
+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
@@ -17,105 +17,125 @@ msgstr ""
msgid "source"
msgstr "source"
#: admin.py:120 admin.py:1
3
8 models/transactions.py:25
#: admin.py:120 admin.py:1
4
8 models/transactions.py:25
#: models/transactions.py:52
msgid "destination"
msgstr "destination"
#: apps.py:1
1 models/notes.py:45
#: apps.py:1
5 models/notes.py:47
msgid "note"
msgstr "note"
#: models/notes.py:2
2
#: models/notes.py:2
4
msgid "account balance"
msgstr "solde du compte"
#: models/notes.py:2
3
#: models/notes.py:2
5
msgid "in centimes, money credited for this instance"
msgstr "en centimes, argent crédité pour cette instance"
#: models/notes.py:2
7
#: models/notes.py:2
9
msgid "active"
msgstr "actif"
#: models/notes.py:3
0
#: models/notes.py:3
2
msgid ""
"Designates whether this note should be treated as active. Unselect this "
"instead of deleting notes."
msgstr ""
"Indique si la note est active. Désactiver cela plutôt que supprimer la note."
#: models/notes.py:3
5
#: models/notes.py:3
7
msgid "display image"
msgstr "image affichée"
#: models/notes.py:4
0
models/transactions.py:55
#: models/notes.py:4
2
models/transactions.py:55
msgid "created at"
msgstr "créée le"
#: models/notes.py:4
6
#: models/notes.py:4
8
msgid "notes"
msgstr "notes"
#: models/notes.py:57
#: models/notes.py:56
msgid "Note"
msgstr "Note"
#: models/notes.py:66 models/notes.py:88
msgid "This alias is already taken."
msgstr "Cet alias est déjà pris."
#: models/notes.py:103
msgid "user"
msgstr "utilisateur"
#: models/notes.py:
61
#: models/notes.py:
107
msgid "one's note"
msgstr "note d'un utilisateur"
#: models/notes.py:
62
#: models/notes.py:
108
msgid "users note"
msgstr "notes des utilisateurs"
#: models/notes.py:
65
#: models/notes.py:
114
#, python-format
msgid "%(user)s's note"
msgstr "Note de %(user)s"
#: models/notes.py:
76
#: models/notes.py:
125
msgid "club"
msgstr "club"
#: models/notes.py:
80
#: models/notes.py:
129
msgid "club note"
msgstr "note d'un club"
#: models/notes.py:
81
#: models/notes.py:
130
msgid "clubs notes"
msgstr "notes des clubs"
#: models/notes.py:
84
#: models/notes.py:
136
#, python-format
msgid "Note for %(club)s club"
msgstr "Note du club %(club)s"
#: models/notes.py:
97 models/transactions.py:32 models/transactions.py:65
#: models/notes.py:
149 models/transactions.py:32 models/transactions.py:66
msgid "type"
msgstr "type"
#: models/notes.py:1
03
#: models/notes.py:1
55
msgid "special note"
msgstr "note spéciale"
#: models/notes.py:1
04
#: models/notes.py:1
56
msgid "special notes"
msgstr "notes spéciales"
#: models/notes.py:1
15
models/transactions.py:18
#: models/notes.py:1
67
models/transactions.py:18
msgid "name"
msgstr "nom"
#: models/notes.py:125
#: models/notes.py:173
msgid "Invalid alias"
msgstr "Alias invalide"
#: models/notes.py:189
msgid "alias"
msgstr "alias"
#: models/notes.py:1
26
#: models/notes.py:1
90
msgid "aliases"
msgstr "alias"
#: models/transactions.py:28 models/transactions.py:62
#: models/notes.py:218
msgid "Alias too long."
msgstr "L'alias est trop long."
#: models/notes.py:221
msgid "An alias with a similar name already exists."
msgstr "Un alias avec un nom similaire existe déjà."
#: models/transactions.py:28 models/transactions.py:63
msgid "amount"
msgstr "montant"
...
...
@@ -135,27 +155,27 @@ msgstr "modèles de transaction"
msgid "quantity"
msgstr "quantité"
#: models/transactions.py:
69
#: models/transactions.py:
70
msgid "reason"
msgstr "raison"
#: models/transactions.py:7
3
#: models/transactions.py:7
4
msgid "valid"
msgstr "valide"
#: models/transactions.py:7
7
#: models/transactions.py:7
9
msgid "transaction"
msgstr "transaction"
#: models/transactions.py:
78
#: models/transactions.py:
80
msgid "transactions"
msgstr "transactions"
#: models/transactions.py:
89
#: models/transactions.py:
116
msgid "membership transaction"
msgstr "transaction d'adhésion"
#: models/transactions.py:
90
#: models/transactions.py:
117
msgid "membership transactions"
msgstr "transactions d'adhésion"
...
...
note/models/notes.py
View file @
fb8e6caf
...
...
@@ -51,7 +51,7 @@ class Note(PolymorphicModel):
"""
:return: Pretty name of this note
"""
return
'Not implemented'
return
str
(
self
)
pretty
.
short_description
=
_
(
'Note'
)
...
...
@@ -63,7 +63,7 @@ class Note(PolymorphicModel):
if
aliases
.
exists
():
# Alias exists, so check if it is linked to this note
if
aliases
.
first
()
.
note
!=
self
:
raise
ValidationError
raise
ValidationError
(
_
(
'This alias is already taken.'
))
# Save note
super
()
.
save
(
*
args
,
**
kwargs
)
...
...
@@ -77,6 +77,20 @@ class Note(PolymorphicModel):
a
.
note
=
self
a
.
save
(
force_insert
=
True
)
def
clean
(
self
,
*
args
,
**
kwargs
):
"""
Verify alias (simulate save)
"""
aliases
=
Alias
.
objects
.
filter
(
name
=
str
(
self
))
if
aliases
.
exists
():
# Alias exists, so check if it is linked to this note
if
aliases
.
first
()
.
note
!=
self
:
raise
ValidationError
(
_
(
'This alias is already taken.'
))
else
:
# Alias does not exist yet, so check if it can exist
a
=
Alias
(
name
=
str
(
self
))
a
.
clean
()
class
NoteUser
(
Note
):
"""
...
...
@@ -144,9 +158,6 @@ class NoteSpecial(Note):
def
__str__
(
self
):
return
self
.
special_type
def
pretty
(
self
):
return
self
.
special_type
class
Alias
(
models
.
Model
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment