Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iPPIDB
ippidb-web
Commits
1a39308f
Commit
1a39308f
authored
1 year ago
by
Fabien MAREUIL
Browse files
Options
Downloads
Patches
Plain Diff
delete files before save new
parent
e2f5c415
No related branches found
Branches containing commit
No related tags found
2 merge requests
!52
Master
,
!50
Update targetcentric
Pipeline
#112371
failed with stages
Stage:
Stage:
Stage:
in 10 minutes and 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ippisite/ippidb/models/targetcentric.py
+25
-3
25 additions, 3 deletions
ippisite/ippidb/models/targetcentric.py
with
25 additions
and
3 deletions
ippisite/ippidb/models/targetcentric.py
+
25
−
3
View file @
1a39308f
...
...
@@ -5,7 +5,7 @@ from django.dispatch import receiver
from
django.db.models.signals
import
pre_delete
,
post_save
,
pre_save
from
.ippidb
import
Protein
from
ippidb.ws
import
convert_pdb_ligand_id_to_iupacandsmiles
import
json
import
json
,
os
def
content
(
instance
,
filename
):
...
...
@@ -527,7 +527,29 @@ def interactdelete(sender, instance, **kwargs):
):
interactfile
.
interact_file
.
delete
()
@receiver
(
pre_save
,
sender
=
Chain
)
def
updatemrcfile
(
sender
,
instance
,
**
kwargs
):
print
(
instance
.
mrc_file
.
path
,
kwargs
)
try
:
old_chain
=
sender
.
objects
.
get
(
id
=
instance
.
id
)
except
sender
.
DoesNotExist
:
old_chain
=
None
if
instance
.
mrc_file
:
if
old_chain
:
if
old_chain
.
mrc_file
:
path_mrc_file
=
old_chain
.
mrc_file
.
path
if
os
.
path
.
exists
(
path_mrc_file
):
os
.
remove
(
path_mrc_file
)
@receiver
(
pre_save
,
sender
=
InteractFile
)
def
updatemrcfile
(
sender
,
instance
,
**
kwargs
):
try
:
old_interact
=
sender
.
objects
.
get
(
id
=
instance
.
id
)
except
sender
.
DoesNotExist
:
old_interact
=
None
if
instance
.
interact_file
:
if
old_interact
:
if
old_interact
.
interact_file
:
path_interact_file
=
old_interact
.
interact_file
.
path
if
os
.
path
.
exists
(
path_interact_file
):
os
.
remove
(
path_interact_file
)
This diff is collapsed.
Click to expand it.
Preview
0%
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