Skip to content
Snippets Groups Projects
Commit 77060ba0 authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

[plotters] models - Plotterparameters are deletable ONLY if not sharing status

is Private
parent 5e9abc6f
No related branches found
No related tags found
1 merge request!222Plotterparams merge
......@@ -50,6 +50,7 @@ from ..common.models import get_contribution_description_filename
from ..code.models import Code
from ..code.models import CodeManager
from ..code.models import get_contribution_source_code_filename
from ..common.models import Shareable
import simplejson
import collections
......@@ -275,6 +276,15 @@ class PlotterParameter(Contribution):
description = models.TextField(default='', blank=True, null=True, help_text=Messages['description'])
plotter = models.ForeignKey(Plotter, related_name='plotting_parameters', null=True)
#_____ Methods __________
def modifiable(self):
"""Can be modified if nobody points at me"""
return super(PlotterParameter, self).modifiable() and (self.defaults.count() == 0)
def deletable(self):
"""Can be deleted if nobody points at me"""
return super(PlotterParameter, self).deletable() and (self.defaults.count() == 0) and (self.sharing == Shareable.PRIVATE)
#_____ Utilities __________
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment