set defaults on title, publisher canme models

main
eric 2023-04-11 13:27:50 -04:00
parent 1720536155
commit 0039e6eafb
3 changed files with 28 additions and 2 deletions

View File

@ -32,6 +32,9 @@ class ContentTyper(object):
if r.status_code == 405: if r.status_code == 405:
r = requests.get(url, headers=HEADERS) r = requests.get(url, headers=HEADERS)
return r return r
except requests.exceptions.SSLError:
r = requests.get(url, verify=False)
r.status_code = 511
except: except:
# unexplained error # unexplained error
return None return None

View File

@ -0,0 +1,23 @@
# Generated by Django 4.1.7 on 2023-04-11 17:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doab_check', '0004_auto_20230330_1419'),
]
operations = [
migrations.AlterField(
model_name='item',
name='publisher_name',
field=models.CharField(default='', max_length=1000),
),
migrations.AlterField(
model_name='item',
name='title',
field=models.CharField(default='', max_length=1000),
),
]

View File

@ -15,8 +15,8 @@ class Item(models.Model):
resource_type = models.CharField(max_length=20, null=True) resource_type = models.CharField(max_length=20, null=True)
# titles, publisher name can change # titles, publisher name can change
title = models.CharField(max_length=1000) title = models.CharField(max_length=1000, default='')
publisher_name = models.CharField(max_length=1000) publisher_name = models.CharField(max_length=1000, default='')
def __str__(self): def __str__(self):
return self.doab.split('/')[1] if '/' in self.doab else self.doab return self.doab.split('/')[1] if '/' in self.doab else self.doab