diff options
author | Magnus Hagander | 2020-04-01 18:34:05 +0000 |
---|---|---|
committer | Magnus Hagander | 2020-04-01 18:34:05 +0000 |
commit | 5902fb5e2a7a5af87203ed97e5e40d7a1da1a3c9 (patch) | |
tree | ee3d5b5070c95094c2f35d6840c6fc7cb540792d /loader/lib/parser.py | |
parent | b5ff1b6eabf3d3eda3d7c393304abf10b0fd0f11 (diff) |
Mark all ForeignKeys as on_delete=CASCADE
Diffstat (limited to 'loader/lib/parser.py')
-rw-r--r-- | loader/lib/parser.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/loader/lib/parser.py b/loader/lib/parser.py index c6ee98f..b9caace 100644 --- a/loader/lib/parser.py +++ b/loader/lib/parser.py @@ -258,12 +258,16 @@ class ArchivesParser(object): # Don't include it if it looks like an attachment if 'Content-Disposition' in p and p['Content-Disposition'].startswith('attachment'): continue - return self.get_payload_as_unicode(p) + t = self.get_payload_as_unicode(p) + if t: + return t if html_instead and p.get_params()[0][0].lower() == 'text/html': # Don't include it if it looks like an attachment if 'Content-Disposition' in p and p['Content-Disposition'].startswith('attachment'): continue - return self.get_payload_as_unicode(p) + t = self.get_payload_as_unicode(p) + if t: + return t if p.is_multipart(): b = self.recursive_first_plaintext(p, html_instead) if b or b == '': |