set defaults on title, publisher canme models
parent
1720536155
commit
0039e6eafb
|
@ -32,6 +32,9 @@ class ContentTyper(object):
|
|||
if r.status_code == 405:
|
||||
r = requests.get(url, headers=HEADERS)
|
||||
return r
|
||||
except requests.exceptions.SSLError:
|
||||
r = requests.get(url, verify=False)
|
||||
r.status_code = 511
|
||||
except:
|
||||
# unexplained error
|
||||
return None
|
||||
|
|
|
@ -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),
|
||||
),
|
||||
]
|
|
@ -15,8 +15,8 @@ class Item(models.Model):
|
|||
resource_type = models.CharField(max_length=20, null=True)
|
||||
|
||||
# titles, publisher name can change
|
||||
title = models.CharField(max_length=1000)
|
||||
publisher_name = models.CharField(max_length=1000)
|
||||
title = models.CharField(max_length=1000, default='')
|
||||
publisher_name = models.CharField(max_length=1000, default='')
|
||||
|
||||
def __str__(self):
|
||||
return self.doab.split('/')[1] if '/' in self.doab else self.doab
|
||||
|
|
Loading…
Reference in New Issue