def post(self, request): if not SiteSetting.as_dict().get(SiteSettingKey.ENABLE_UPLOADS): return redirect('upload.list') if self.get_upload_slots_used() > request.user.upload_limit: messages.error(request, _('You have reached your limit of {} uploads within the past 24 hours.').format(request.user.upload_limit)) return redirect('upload.list') manga = Manga() manga.save(updated_by=request.user) return redirect('manga.edit.images', id=manga.id, slug=manga.slug)
def test_manga_delete_draft(self): manga = Manga(status=MangaStatus.DRAFT) manga.save(updated_by=self.user) manga.delete() self.assertFalse(Manga.all.filter(id=manga.id).exists())
def test_manga_save_slugify(self): manga = Manga(title='Some Brand New Title') manga.save(updated_by=self.user) self.assertEqual(manga.slug, 'some-brand-new-title')