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

Commit 646a271

Browse files
authored
Merge pull request #106 from hggh/feature/django20
Django 2.0: added on_delete argument
2 parents e9d791d + f5d0b04 commit 646a271

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

.travis.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
language: python
22

3-
python:
4-
- "2.7"
5-
- "3.4"
6-
7-
env:
8-
- DJANGO_VERSION=Django==1.8
9-
- DJANGO_VERSION=Django==1.9
10-
- DJANGO_VERSION=Django==1.10
11-
- DJANGO_VERSION=Django==1.11
3+
matrix:
4+
include:
5+
- python: 2.7
6+
env: DJANGO_VERSION=Django==1.8
7+
- python: 2.7
8+
env: DJANGO_VERSION=Django==1.9
9+
- python: 2.7
10+
env: DJANGO_VERSION=Django==1.10
11+
- python: 2.7
12+
env: DJANGO_VERSION=Django==1.11
13+
- python: 3.4
14+
env: DJANGO_VERSION=Django==1.8
15+
- python: 3.4
16+
env: DJANGO_VERSION=Django==1.9
17+
- python: 3.4
18+
env: DJANGO_VERSION=Django==1.10
19+
- python: 3.4
20+
env: DJANGO_VERSION=Django==1.11
21+
- python: 3.4
22+
env: DJANGO_VERSION=Django==2.0
1223

1324
# command to install dependencies
1425
install:

mailqueue/migrations/0001_initial.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ class Migration(migrations.Migration):
5050
migrations.AddField(
5151
model_name='attachment',
5252
name='email',
53-
field=models.ForeignKey(blank=True, to='mailqueue.MailerMessage', null=True),
53+
field=models.ForeignKey(
54+
on_delete=models.deletion.CASCADE,
55+
blank=True,
56+
to='mailqueue.MailerMessage',
57+
null=True,
58+
),
5459
preserve_default=True,
5560
),
5661
]

mailqueue/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class Attachment(models.Model):
143143
file_attachment = models.FileField(storage=get_storage(), upload_to=upload_to,
144144
blank=True, null=True)
145145
original_filename = models.CharField(default=None, max_length=250, blank=False)
146-
email = models.ForeignKey(MailerMessage, blank=True, null=True)
146+
email = models.ForeignKey(MailerMessage, on_delete=models.CASCADE, blank=True, null=True)
147147

148148
class Meta:
149149
verbose_name = _('Attachment')

0 commit comments

Comments
 (0)