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

Répare le compte de caractères des contenus #4171

Merged
merged 1 commit into from Feb 3, 2017

Conversation

vhf
Copy link
Contributor

@vhf vhf commented Feb 1, 2017

Q R
Type de modification correction de bug
Ticket(s) (issue(s)) concerné(s) #4093

Hope, une 2e PR pour corriger #4093

QA

  • Créer un article ou tuto
  • Le publier
  • Le renommer (le slug doit changer, l'emplacement du repo aussi)
  • Le compte de caractères doit être None (mettre à NULL si besoin)
  • Lancer la commande adjust_char_count

@vhf vhf added C-Back Concerne le back-end Django Bloquant Ticket qui doit être traité avant la prochaine mise à jour QA svp labels Feb 1, 2017
"""

def handle(self, *args, **options):
for content in PublishedContent.objects.filter(nb_letter=None):
content.nb_letter = content.get_nb_letters()
for content in PublishedContent.objects.filter(char_count=None, must_redirect=False):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le problème était là : les contenus redirigés plantaient la commande.

@coveralls
Copy link

coveralls commented Feb 1, 2017

Coverage Status

Coverage decreased (-0.01%) to 86.999% when pulling 42eac60 on vhf:fix-4093 into 96c4db9 on zestedesavoir:dev.

@@ -126,7 +126,7 @@ def publish_content(db_object, versioned, is_major_update=True):
public_version.content = db_object
public_version.must_reindex = True
public_version.save()
public_version.nb_letter = public_version.get_nb_letters(md_file_path)
public_version.char_count = public_version.get_char_count(md_file_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il ne manquerais pas une migration ? J'ai checkout ta branche, il me met « no such colomn tutorialv2_publishedcontent.char_count »

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ça doit être mon installation qui à foirer.

@DevHugo
Copy link
Contributor

DevHugo commented Feb 3, 2017

QA: Ok sauf cette histoire de fichier de migration.

Mon fichier de migration généré :

# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('tutorialv2', '0015_publishedcontent_nb_letter'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='publishedcontent',
            name='nb_letter',
        ),
        migrations.AddField(
            model_name='publishedcontent',
            name='char_count',
            field=models.IntegerField(default=None, null=True, verbose_name=b'Nombre de lettres du contenu', blank=True),
        ),
    ]

@vhf
Copy link
Contributor Author

vhf commented Feb 3, 2017

Il y a peut-être un bug quelque part. J'ai comparé la migration que tu proposes avec celle de cette PR, artragis aussi, personne n'a trouvé de différence. Est-ce qu'elle n'est pas détectée par Django ? Tu peux essayer de la renommer ?

@DevHugo
Copy link
Contributor

DevHugo commented Feb 3, 2017

Excuse moi, je sais pas ce qui s'est passé, quand j'ai fetch la branche et j'ai fait un migrate, j'ai pas vu le fichier de migration et il me l'a réclamé. Peut-être qu'à force de tester les PR, j'ai fait merder mes migrations ou la base de données.

Autant pour moi.

@DevHugo DevHugo merged commit f4d041b into zestedesavoir:dev Feb 3, 2017
@vhf
Copy link
Contributor Author

vhf commented Feb 3, 2017

Haha pas grave ! Du coup si c'est bon je te laisse merger ça. Merci !

@vhf vhf deleted the fix-4093 branch February 3, 2017 19:08
@vhf vhf added this to the Version de développement milestone Feb 5, 2017
@vhf vhf added S-BUG Corrige un problème and removed Bloquant Ticket qui doit être traité avant la prochaine mise à jour labels Feb 5, 2017
@gllmc gllmc removed the QA svp label Apr 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Back Concerne le back-end Django S-BUG Corrige un problème
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants