File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -823,6 +823,30 @@ class Meta:
823823 ]
824824
825825
826+ class Note (models .Model ):
827+ patch = models .ForeignKey (
828+ Patch ,
829+ related_name = 'note' ,
830+ related_query_name = 'note' ,
831+ on_delete = models .CASCADE ,
832+ )
833+ submitter = models .ForeignKey (User , on_delete = models .CASCADE )
834+ last_modified = models .DateTimeField (default = tz_utils .now )
835+ content = models .TextField (null = False , blank = True )
836+ maintainer_only = models .BooleanField (default = True )
837+ __original_content = None
838+
839+ def __init__ (self , * args , ** kwargs ):
840+ super ().__init__ (* args , ** kwargs )
841+ self .__original_content = self .content
842+
843+ def save (self , * args , ** kwargs ):
844+ if self .content != self .__original_content :
845+ self .last_modified = tz_utils .now ().isoformat ()
846+ self .__original_content = self .content
847+ super (Note , self ).save (* args , ** kwargs )
848+
849+
826850class Series (FilenameMixin , models .Model ):
827851 """A collection of patches."""
828852
You can’t perform that action at this time.
0 commit comments