Fix linting errors

This commit is contained in:
Christian Garza 2020-07-10 02:59:05 -07:00
parent a14271a67a
commit f44da153fb
3 changed files with 21 additions and 12 deletions

View file

@ -1356,11 +1356,15 @@ def _build_pokemons():
"front_female": file_path_or_none( "front_female": file_path_or_none(
poke_sprites.format("female/" + file_name_png) poke_sprites.format("female/" + file_name_png)
), ),
"front_shiny": file_path_or_none(poke_sprites.format("shiny/" + file_name_png)), "front_shiny": file_path_or_none(
poke_sprites.format("shiny/" + file_name_png)
),
"front_shiny_female": file_path_or_none( "front_shiny_female": file_path_or_none(
poke_sprites.format("shiny/female/" + file_name_png) poke_sprites.format("shiny/female/" + file_name_png)
), ),
"back_default": file_path_or_none(poke_sprites.format("back/" + file_name_png)), "back_default": file_path_or_none(
poke_sprites.format("back/" + file_name_png)
),
"back_female": file_path_or_none( "back_female": file_path_or_none(
poke_sprites.format("back/female/" + file_name_png) poke_sprites.format("back/female/" + file_name_png)
), ),
@ -1372,10 +1376,16 @@ def _build_pokemons():
), ),
"other": { "other": {
"dream_world": { "dream_world": {
"front_default": file_path_or_none(poke_sprites.format(dream_world.format(file_name_svg))), "front_default": file_path_or_none(
"front_female": file_path_or_none(poke_sprites.format(dream_world.format("female/" + file_name_svg))) poke_sprites.format(dream_world.format(file_name_svg))
} ),
"front_female": file_path_or_none(
poke_sprites.format(
dream_world.format("female/" + file_name_svg)
)
),
} }
},
} }
yield PokemonSprites( yield PokemonSprites(
id=int(info[0]), id=int(info[0]),

View file

@ -4,13 +4,13 @@ from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('pokemon_v2', '0004_iso639length_20191217'), ("pokemon_v2", "0004_iso639length_20191217"),
] ]
operations = [ operations = [
migrations.AlterField( migrations.AlterField(
model_name='pokemonsprites', model_name="pokemonsprites",
name='sprites', name="sprites",
field=models.CharField(max_length=20000), field=models.CharField(max_length=20000),
), ),
] ]

View file

@ -2744,9 +2744,8 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
replace_sprite_url(value) replace_sprite_url(value)
else: else:
if d[key]: if d[key]:
d[key] = ( d[key] = "https://" + host + d[key].replace("/media/", "")
"https://" + host + d[key].replace("/media/", "")
)
replace_sprite_url(sprites_data) replace_sprite_url(sprites_data)
return sprites_data return sprites_data