Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
31
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
0c00a934
Commit
0c00a934
authored
5 years ago
by
ynerant
Browse files
Options
Downloads
Patches
Plain Diff
Translate some docs
parent
d8a785d3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!56
Corrections
Pipeline
#7924
passed with stages
in 4 minutes and 4 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/logs/middlewares.py
+1
-1
1 addition, 1 deletion
apps/logs/middlewares.py
apps/logs/signals.py
+4
-5
4 additions, 5 deletions
apps/logs/signals.py
with
5 additions
and
6 deletions
apps/logs/middlewares.py
+
1
−
1
View file @
0c00a934
...
...
@@ -35,7 +35,7 @@ def get_current_authenticated_user():
class
LogsMiddleware
(
object
):
"""
Ce
middleware
permet de récupérer l
'
utilisateur actif ainsi que son
adress
e IP à chaque connexion
.
This
middleware
get the current user with his or her IP
ad
d
ress
on each request
.
"""
def
__init__
(
self
,
get_response
):
...
...
This diff is collapsed.
Click to expand it.
apps/logs/signals.py
+
4
−
5
View file @
0c00a934
...
...
@@ -33,8 +33,7 @@ EXCLUDED = [
def
pre_save_object
(
sender
,
instance
,
**
kwargs
):
"""
Avant la sauvegarde d
'
un modèle, on récupère l
'
ancienne instance actuellement en base de données
que l
'
on garde en mémoire
Before a model get saved, we get the previous instance that is currently in the database
"""
qs
=
sender
.
objects
.
filter
(
pk
=
instance
.
pk
).
all
()
if
qs
.
exists
():
...
...
@@ -45,8 +44,8 @@ def pre_save_object(sender, instance, **kwargs):
def
save_object
(
sender
,
instance
,
**
kwargs
):
"""
Dès qu
'
un modèle est
sa
u
ve
gardé, une entrée dans la table `Changelog` est ajouté dans la base de données
af
in
de répertorier chaque
modification
effectué
e
Each time a model is
save
d, an entry in the table `Changelog` is added in the database
in
order to store each
modification
mad
e
"""
# noinspection PyProtectedMember
if
instance
.
_meta
.
label_lower
in
EXCLUDED
:
...
...
@@ -102,7 +101,7 @@ def save_object(sender, instance, **kwargs):
def
delete_object
(
sender
,
instance
,
**
kwargs
):
"""
Dès qu
'
un modèle est supprimé, une entrée dans la table `Changelog` est ajouté dans la base de données
Each time a model is deleted, an entry in the table `Changelog` is added in the database
"""
# noinspection PyProtectedMember
if
instance
.
_meta
.
label_lower
in
EXCLUDED
:
...
...
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