diff options
author | Stephen Finucane <stephen.finucane@intel.com> | 2015-10-16 00:32:01 +0100 |
---|---|---|
committer | Stephen Finucane <stephen.finucane@intel.com> | 2016-03-16 09:38:00 +0000 |
commit | 070083154c3cebb0f44e52fe742b00e68442ef22 (patch) | |
tree | 6322f1889a7644b2c5ead3e358ffa42a6855f0d7 /patchwork/migrations | |
parent | ef56359fb7762126edac213d36727f4e0655f9f8 (diff) | |
download | patchwork-070083154c3cebb0f44e52fe742b00e68442ef22.tar patchwork-070083154c3cebb0f44e52fe742b00e68442ef22.tar.gz |
models: Pull common email behavior into mixin
A "Patch" and "Comment" share a common ancestor: emails. As a result
of this many fields are similar between the two. Rather than
duplicating code, pull the similar code out of the aforementioned
classes and into a Mixin.
This has the side effect of removing restrictions on Comment.content,
but this is probably OK: it's possible that someone could send an
empty mail in reply to a patch and we should show that.
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
Diffstat (limited to 'patchwork/migrations')
-rw-r--r-- | patchwork/migrations/0008_add_email_mixin.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/patchwork/migrations/0008_add_email_mixin.py b/patchwork/migrations/0008_add_email_mixin.py new file mode 100644 index 0000000..e7ffd16 --- /dev/null +++ b/patchwork/migrations/0008_add_email_mixin.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('patchwork', '0007_move_comment_content_to_patch_content'), + ] + + operations = [ + migrations.AlterField( + model_name='comment', + name='content', + field=models.TextField(null=True, blank=True), + ), + ] |