Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenQuizz
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Weber Rodolphe
OpenQuizz
Commits
22cbcd5c
Commit
22cbcd5c
authored
Sep 30, 2021
by
Jérémie Passerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Derniere correction bugs
parent
aa3b09f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
contenu_dao.py
modele/contenu_dao.py
+4
-2
No files found.
modele/contenu_dao.py
View file @
22cbcd5c
...
@@ -534,15 +534,17 @@ class ContenuDao:
...
@@ -534,15 +534,17 @@ class ContenuDao:
# on modifie les tags
# on modifie les tags
self
.
base_donnees
.
contenu
.
update_one
({
"_id"
:
ObjectId
(
id_contenu
)},
{
"$set"
:
{
"tags_fixes"
:
tags
}})
self
.
base_donnees
.
contenu
.
update_one
({
"_id"
:
ObjectId
(
id_contenu
)},
{
"$set"
:
{
"tags_fixes"
:
tags
}})
#
et le chemin du
fichier
#
on créée le nouveau chemin pour le
fichier
chemin_tags
=
'/'
.
join
(
tags
)
+
"/"
chemin_tags
=
'/'
.
join
(
tags
)
+
"/"
#
mettre a jour le chemin du contenu
#
on le met a jour
self
.
base_donnees
.
contenu
.
update_one
({
"_id"
:
ObjectId
(
id_contenu
)},
self
.
base_donnees
.
contenu
.
update_one
({
"_id"
:
ObjectId
(
id_contenu
)},
{
"$set"
:
{
"fichier"
:
chemin_tags
+
id_contenu
+
"/"
+
id_contenu
}})
{
"$set"
:
{
"fichier"
:
chemin_tags
+
id_contenu
+
"/"
+
id_contenu
}})
#on créée le nouveau chemin (tous les répertoires)
Path
(
self
.
chemin
+
chemin_tags
+
id_contenu
+
"/"
)
.
mkdir
(
0o777
,
parents
=
True
,
exist_ok
=
True
)
Path
(
self
.
chemin
+
chemin_tags
+
id_contenu
+
"/"
)
.
mkdir
(
0o777
,
parents
=
True
,
exist_ok
=
True
)
# on change l'ancien chemin (qu'on supprime) pour créer le nouveau
Path
(
ancien_chemin
)
.
rename
(
self
.
get_chemin_du_contenu
(
id_contenu
))
Path
(
ancien_chemin
)
.
rename
(
self
.
get_chemin_du_contenu
(
id_contenu
))
self
.
rm_tree
(
Path
(
ancien_chemin
[:
ancien_chemin
.
rfind
(
"/"
)
+
1
]))
self
.
rm_tree
(
Path
(
ancien_chemin
[:
ancien_chemin
.
rfind
(
"/"
)
+
1
]))
# Path(ancien_chemin[:ancien_chemin.rfind("/") + 1]).rmdir()
# Path(ancien_chemin[:ancien_chemin.rfind("/") + 1]).rmdir()
...
...
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