@@ -1195,22 +1195,15 @@ class JIRA_PKey(models.Model):
11951195
11961196
11971197class Notifications (models .Model ):
1198- engagement_added = MultiSelectField (choices = NOTIFICATION_CHOICES ,
1199- default = 'alert' , blank = True )
1200- test_added = MultiSelectField (choices = NOTIFICATION_CHOICES ,
1201- default = 'alert' , blank = True )
1202- results_added = MultiSelectField (choices = NOTIFICATION_CHOICES ,
1203- default = 'alert' , blank = True )
1204- report_created = MultiSelectField (choices = NOTIFICATION_CHOICES ,
1205- default = 'alert' , blank = True )
1206- jira_update = MultiSelectField (choices = NOTIFICATION_CHOICES ,
1207- default = 'alert' , blank = True )
1208- upcoming_engagement = MultiSelectField (choices = NOTIFICATION_CHOICES ,
1209- default = 'alert' , blank = True )
1210- user_mentioned = MultiSelectField (choices = NOTIFICATION_CHOICES ,
1211- default = 'alert' , blank = True )
1212- other = MultiSelectField (choices = NOTIFICATION_CHOICES , default = 'alert' ,
1213- blank = True )
1198+ engagement_added = MultiSelectField (choices = NOTIFICATION_CHOICES , default = 'alert' , blank = True )
1199+ test_added = MultiSelectField (choices = NOTIFICATION_CHOICES , default = 'alert' , blank = True )
1200+ results_added = MultiSelectField (choices = NOTIFICATION_CHOICES , default = 'alert' , blank = True )
1201+ report_created = MultiSelectField (choices = NOTIFICATION_CHOICES , default = 'alert' , blank = True )
1202+ jira_update = MultiSelectField (choices = NOTIFICATION_CHOICES , default = 'alert' , blank = True )
1203+ upcoming_engagement = MultiSelectField (choices = NOTIFICATION_CHOICES , default = 'alert' , blank = True )
1204+ user_mentioned = MultiSelectField (choices = NOTIFICATION_CHOICES , default = 'alert' , blank = True )
1205+ code_review = MultiSelectField (choices = NOTIFICATION_CHOICES , default = 'alert' , blank = True )
1206+ other = MultiSelectField (choices = NOTIFICATION_CHOICES , default = 'alert' , blank = True )
12141207 user = models .ForeignKey (User , default = None , null = True , editable = False )
12151208
12161209
@@ -1359,7 +1352,7 @@ class App_Analysis(models.Model):
13591352 user = models .ForeignKey (User , editable = True )
13601353 confidence = models .IntegerField (blank = True , null = True , verbose_name = 'Confidence level' )
13611354 version = models .CharField (max_length = 200 , null = True , blank = True , verbose_name = 'Version Number' )
1362- icon = models .CharField (max_length = 200 , null = True , blank = True , )
1355+ icon = models .CharField (max_length = 200 , null = True , blank = True )
13631356 website = models .URLField (max_length = 400 , null = True , blank = True )
13641357 website_found = models .URLField (max_length = 400 , null = True , blank = True )
13651358 created = models .DateTimeField (null = False , editable = False , default = now )
@@ -1368,17 +1361,51 @@ class Objects_Review(models.Model):
13681361 name = models .CharField (max_length = 100 , null = True )
13691362 created = models .DateTimeField (null = False , editable = False , default = now )
13701363
1364+ def __unicode__ (self ):
1365+ return self .name
1366+
13711367class Objects (models .Model ):
1372- engagement = models .ForeignKey (Engagement )
1373- name = models .CharField (max_length = 100 , null = True )
1374- path = models .CharField (max_length = 600 , null = False )
1368+ product = models .ForeignKey (Product )
1369+ name = models .CharField (max_length = 100 , null = True , blank = True )
1370+ path = models .CharField (max_length = 600 , verbose_name = 'Full file path' , null = True , blank = True )
1371+ folder = models .CharField (max_length = 400 , verbose_name = 'Folder' , null = True , blank = True )
1372+ artifact = models .CharField (max_length = 400 , verbose_name = 'Artifact' , null = True , blank = True )
13751373 review_status = models .ForeignKey (Objects_Review )
13761374 created = models .DateTimeField (null = False , editable = False , default = now )
13771375
1376+ def __unicode__ (self ):
1377+ name = None
1378+ if self .path != None :
1379+ name = self .path
1380+ elif self .folder != None :
1381+ name = self .folder
1382+ elif self .artifact != None :
1383+ name = self .artifact
1384+
1385+ return name
1386+
1387+ class Meta :
1388+ unique_together = [('product' , 'path' )]
1389+
13781390class Objects_Engagement (models .Model ):
13791391 engagement = models .ForeignKey (Engagement )
1380- object = models .ForeignKey (Objects )
1392+ object_id = models .ForeignKey (Objects )
1393+ build_id = models .CharField (max_length = 150 , null = True )
13811394 created = models .DateTimeField (null = False , editable = False , default = now )
1395+ full_url = models .URLField (max_length = 400 , null = True , blank = True )
1396+ type = models .CharField (max_length = 30 , null = True )
1397+ percentUnchanged = models .CharField (max_length = 10 , null = True )
1398+
1399+ def __unicode__ (self ):
1400+ data = ""
1401+ if self .object_id .path :
1402+ data = self .object_id .path
1403+ elif self .object_id .folder :
1404+ data = self .object_id .folder
1405+ elif self .object_id .artifact :
1406+ data = self .object_id .artifact
1407+
1408+ return data + " | " + self .engagement .name + " | " + str (self .engagement .id )
13821409
13831410# Register for automatic logging to database
13841411auditlog .register (Dojo_User )
0 commit comments