current_domain = lazy(lambda: Site.objects.get_current().domain, str)()
+
+
def full_url(obj):
return 'http://%s%s' % (
current_domain,
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('-q', '--quiet', action='store_false', dest='verbose', default=True,
- help='Suppress output'),
+ help='Suppress output'),
)
help = 'Checks cover sources and licenses.'
good_license = re.compile("(%s)" % ")|(".join(
app_settings.GOOD_LICENSES))
- with transaction.commit_on_success():
+ with transaction.atomic():
for book in Book.objects.all().order_by('slug').iterator():
extra_info = book.extra_info
if not extra_info.get('cover_url'):
else:
without_cover.append(book)
else:
- if not extra_info.get('cover_source', ''
- ).startswith(redakcja_url):
+ if not extra_info.get('cover_source', '').startswith(redakcja_url):
not_redakcja.append(book)
match = re_license.match(extra_info.get('cover_by', ''))
if match: