Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchro mobile : Problème de pictogramme sur les thèmes #3814

Closed
juggler31 opened this issue Oct 30, 2023 · 1 comment
Closed

Synchro mobile : Problème de pictogramme sur les thèmes #3814

juggler31 opened this issue Oct 30, 2023 · 1 comment

Comments

@juggler31
Copy link
Contributor

juggler31 commented Oct 30, 2023

Il arrive que la synchro-mobile soit en échec lors que des thèmes n'ont pas de pictogramme associés.

Après analyse, il s'avère que certains parsers semblent avoir créés automatiquement des thèmes sans pictogramme.

Deux approches possible :

Première approche

Dans cette méthode :

def get_pictogram(self, obj):
file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url

Rajouter un check pour savoir si un pictogramme est présent (évite à la synchro de casser)

Seconde approche

Empêcher avec les parseurs de créer un thème sans pictogramme (mais dans ce cas quel pictogramme utiliser par défaut ?)

A noter:

  • Les deux peuvent être fait.
  • Si possible au passage corriger :
    def get_pictogram(self, obj):
    file_name, file_extension = os.path.splitext(str(obj.pictogram.url))
    return '{file}.png'.format(file=file_name) if file_extension == '.svg' else obj.pictogram.url
@babastienne babastienne changed the title Problème de pictogramme sur les thèmes Synchro mobile : Problème de pictogramme sur les thèmes Oct 30, 2023
@juggler31
Copy link
Contributor Author

La première approche a été validé en réu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants