Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #106 from hggh/feature/django20
Browse files Browse the repository at this point in the history
Django 2.0: added on_delete argument
  • Loading branch information
dstegelman committed Dec 8, 2017
2 parents e9d791d + f5d0b04 commit 646a271
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
29 changes: 20 additions & 9 deletions .travis.yml
@@ -1,14 +1,25 @@
language: python

python:
- "2.7"
- "3.4"

env:
- DJANGO_VERSION=Django==1.8
- DJANGO_VERSION=Django==1.9
- DJANGO_VERSION=Django==1.10
- DJANGO_VERSION=Django==1.11
matrix:
include:
- python: 2.7
env: DJANGO_VERSION=Django==1.8
- python: 2.7
env: DJANGO_VERSION=Django==1.9
- python: 2.7
env: DJANGO_VERSION=Django==1.10
- python: 2.7
env: DJANGO_VERSION=Django==1.11
- python: 3.4
env: DJANGO_VERSION=Django==1.8
- python: 3.4
env: DJANGO_VERSION=Django==1.9
- python: 3.4
env: DJANGO_VERSION=Django==1.10
- python: 3.4
env: DJANGO_VERSION=Django==1.11
- python: 3.4
env: DJANGO_VERSION=Django==2.0

# command to install dependencies
install:
Expand Down
7 changes: 6 additions & 1 deletion mailqueue/migrations/0001_initial.py
Expand Up @@ -50,7 +50,12 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='attachment',
name='email',
field=models.ForeignKey(blank=True, to='mailqueue.MailerMessage', null=True),
field=models.ForeignKey(
on_delete=models.deletion.CASCADE,
blank=True,
to='mailqueue.MailerMessage',
null=True,
),
preserve_default=True,
),
]
2 changes: 1 addition & 1 deletion mailqueue/models.py
Expand Up @@ -143,7 +143,7 @@ class Attachment(models.Model):
file_attachment = models.FileField(storage=get_storage(), upload_to=upload_to,
blank=True, null=True)
original_filename = models.CharField(default=None, max_length=250, blank=False)
email = models.ForeignKey(MailerMessage, blank=True, null=True)
email = models.ForeignKey(MailerMessage, on_delete=models.CASCADE, blank=True, null=True)

class Meta:
verbose_name = _('Attachment')
Expand Down

0 comments on commit 646a271

Please sign in to comment.