Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDE
nk20
Commits
fb8e6caf
Unverified
Commit
fb8e6caf
authored
5 years ago
by
me5na7qbjqbrp
Browse files
Options
Downloads
Patches
Plain Diff
Implement clean methode for Note
parent
32a37eae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#7642
passed with stage
in 2 minutes and 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
note/locale/fr/LC_MESSAGES/django.po
+51
-31
51 additions, 31 deletions
note/locale/fr/LC_MESSAGES/django.po
note/models/notes.py
+16
-5
16 additions, 5 deletions
note/models/notes.py
with
67 additions
and
36 deletions
note/locale/fr/LC_MESSAGES/django.po
+
51
−
31
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:4
5
#: apps.py:1
5
models/notes.py:4
7
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:
6
1
#: models/notes.py:1
07
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:
8
1
#: models/notes.py:1
30
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:9
7
models/transactions.py:32 models/transactions.py:6
5
#: models/notes.py:
14
9 models/transactions.py:32 models/transactions.py:6
6
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:
7
8
#: models/transactions.py:8
0
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"
...
...
This diff is collapsed.
Click to expand it.
note/models/notes.py
+
16
−
5
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
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment