Changeset - 6bbf3225dfdd
[Not reviewed]
default
0 1 0
Branko Majic (branko) - 11 years ago 2013-02-28 23:38:06
branko@majic.rs
Added check to verify that the connecting interfaces in communication belong to same project.
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
conntrackt/models.py
Show inline comments
 
@@ -210,7 +210,11 @@ class Communication(models.Model):
 
        """
 

	
 
        if self.source.entity == self.destination.entity:
 
            raise ValidationError('Source and destination entities must differ.')
 
            raise ValidationError('Source and destination entities are identical.')
 

	
 
        if self.source.entity.project != self.destination.entity.project:
 
            raise ValidationError('Source and destination entities do not belong to the same project')
 

	
 
        if (self.protocol.upper(), self.protocol.upper()) not in self.PROTOCOL_CHOICES:
 
            raise ValidationError('%s is not a supported protocol.' % self.protocol)
 

	
0 comments (0 inline, 0 general)