Commit a2d781f732f2e04acc93b46f6a443c0b652e6d5c
1 parent
e7d2919c
Exists in
master
and in
39 other branches
Using all_objects manager
Sergio commiting.
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
src/super_archives/management/commands/import_emails.py
| ... | ... | @@ -135,7 +135,7 @@ class Command(BaseCommand, object): |
| 135 | 135 | subject_slug = slugify(email.subject_clean) |
| 136 | 136 | thread = self.THREAD_CACHE.get(subject_slug, {}).get(mailinglist.id) |
| 137 | 137 | if thread is None: |
| 138 | - thread = Thread.objects.get_or_create( | |
| 138 | + thread = Thread.all_objects.get_or_create( | |
| 139 | 139 | mailinglist=mailinglist, |
| 140 | 140 | subject_token=subject_slug |
| 141 | 141 | )[0] |
| ... | ... | @@ -167,7 +167,7 @@ class Command(BaseCommand, object): |
| 167 | 167 | else: |
| 168 | 168 | # If the message is already at the database don't do anything |
| 169 | 169 | try: |
| 170 | - messages = Message.objects.get( | |
| 170 | + messages = Message.all_objects.get( | |
| 171 | 171 | message_id=msg_id, |
| 172 | 172 | thread__mailinglist=mailinglist |
| 173 | 173 | ) |
| ... | ... | @@ -196,7 +196,7 @@ class Command(BaseCommand, object): |
| 196 | 196 | |
| 197 | 197 | subject = email_msg.get_subject() |
| 198 | 198 | |
| 199 | - email = Message.objects.create( | |
| 199 | + email = Message.all_objects.create( | |
| 200 | 200 | message_id=email_msg.get('Message-ID'), |
| 201 | 201 | from_address=email_addr, |
| 202 | 202 | subject=subject, | ... | ... |