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

500 ошибка в админке #656

Closed
themygit opened this issue Dec 4, 2018 · 6 comments
Closed

500 ошибка в админке #656

themygit opened this issue Dec 4, 2018 · 6 comments
Assignees
Labels
1 hour typical issue size. It's one pdd hour 1 burning issue bug from PO from product owner. It's hellxi

Comments

@themygit
Copy link

themygit commented Dec 4, 2018

https://www.shopelectro.ru/admin/shopelectro/productpage/?has_category=no

@duker33 duker33 added bug 1 hour typical issue size. It's one pdd hour 1 burning issue from PO from product owner. It's hellxi labels Dec 4, 2018
@duker33
Copy link
Contributor

duker33 commented Dec 8, 2018

found this lines in failed admin traceback from prod:

se-python                |   File "/usr/app/src/shopelectro/admin.py", line 163, in model_id
se-python                |     return obj.model.vendor_code

Right now we have 65 not active product pages with no binded products. Seems it's because of them.

I suppose, that they appeared from update_db command. We can't test it now with TDD

@duker33
Copy link
Contributor

duker33 commented Dec 9, 2018

Analyzed bad pages set. They are old, but already bad copies of existing and active products:

In [1]:  pp = ProductPage.objects.filter(shopelectro_product=None).first()

In [2]: p = Product.objects.get(name=pp.name)

In [3]: pp.id, p.page.id
Out[3]: (8344, 8379)

In [4]: pp.is_active, p.page.is_active
Out[4]: (False, True)

In [5]: pp.date_published, p.page.date_published
Out[6]: (datetime.date(2018, 7, 31), datetime.date(2018, 7, 31))

I'll just rm all such bad pages from prod db. But the problem is to define where this pages came from.
I'll write test that update product with commands update_db mech. I'll try to catch bad pages copies creating

@duker33
Copy link
Contributor

duker33 commented Dec 10, 2018

found pages consistency issue in update_db commands. Reflected it in related PR.
But this issue seems not fully related to our problem

@duker33
Copy link
Contributor

duker33 commented Dec 10, 2018

Removed problem pages from prod.
Problem with link solved, as we waited

In [1]: bad_pages = ProductPage.objects.filter(shopelectro_product=None)

In [2]: bad_pages.count()
Out[2]: 65

In [3]: bad_pages.delete()
Out[3]: (65, {'images.Image': 0, 'shopelectro.ProductPage': 65})

duker33 added a commit that referenced this issue Dec 10, 2018
duker33 added a commit that referenced this issue Dec 11, 2018
Co-Authored-By: duker33 <duker33@gmail.com>
duker33 added a commit that referenced this issue Dec 11, 2018
duker33 added a commit that referenced this issue Dec 11, 2018
* #656  Prove update_db pages consistency problems with test

* #656  Apply linter rules

* #656  Remove reduntand comment

Co-Authored-By: duker33 <duker33@gmail.com>

* #656  Skip invalid links bear
@0pdd
Copy link
Collaborator

0pdd commented Dec 11, 2018

@themygit the puzzle #669 is still not solved.

@0pdd
Copy link
Collaborator

0pdd commented Dec 20, 2018

@themygit the only puzzle #669 is solved here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 hour typical issue size. It's one pdd hour 1 burning issue bug from PO from product owner. It's hellxi
Projects
None yet
Development

No branches or pull requests

4 participants