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

Error while trying to delete an article #857

Closed
citxx opened this issue Mar 17, 2018 · 0 comments
Closed

Error while trying to delete an article #857

citxx opened this issue Mar 17, 2018 · 0 comments

Comments

@citxx
Copy link
Contributor

@citxx citxx commented Mar 17, 2018

Stack trace:

In [2]: wiki.models.Article.objects.all().delete()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-d36bb49ac83b> in <module>()
----> 1 wiki.models.Article.objects.all().delete()

~/programming/SIStema/venv/lib/python3.5/site-packages/django/db/models/query.py in delete(self)
    660         collector = Collector(using=del_query.db)
    661         collector.collect(del_query)
--> 662         deleted, _rows_count = collector.delete()
    663 
    664         # Clear the result cache, in case this QuerySet gets reused.

~/programming/SIStema/venv/lib/python3.5/site-packages/django/db/models/deletion.py in delete(self)
    276                 if not model._meta.auto_created:
    277                     signals.pre_delete.send(
--> 278                         sender=model, instance=obj, using=self.using
    279                     )
    280 

~/programming/SIStema/venv/lib/python3.5/site-packages/django/dispatch/dispatcher.py in send(self, sender, **named)
    176         return [
    177             (receiver, receiver(signal=self, sender=sender, **named))
--> 178             for receiver in self._live_receivers(sender)
    179         ]
    180 

~/programming/SIStema/venv/lib/python3.5/site-packages/django/dispatch/dispatcher.py in <listcomp>(.0)
    176         return [
    177             (receiver, receiver(signal=self, sender=sender, **named))
--> 178             for receiver in self._live_receivers(sender)
    179         ]
    180 

~/programming/SIStema/venv/lib/python3.5/site-packages/wiki/decorators.py in wrapper(*args, **kwargs)
    178         if kwargs.get('raw', False):
    179             return
--> 180         return signal_handler(*args, **kwargs)
    181     return wrapper

~/programming/SIStema/venv/lib/python3.5/site-packages/wiki/models/article.py in on_article_delete_clear_cache(instance, **kwargs)
    410 def on_article_delete_clear_cache(instance, **kwargs):
    411     _clear_ancestor_cache(instance)
--> 412     instance.clear_cache()
    413 
    414 

~/programming/SIStema/venv/lib/python3.5/site-packages/wiki/models/article.py in clear_cache(self)
    239 
    240     def clear_cache(self):
--> 241         cache.delete(self.get_cache_key())
    242 
    243     def get_absolute_url(self):

~/programming/SIStema/venv/lib/python3.5/site-packages/wiki/models/article.py in get_cache_key(self)
    203         return "wiki:article:{id:d}:{lang:s}".format(
    204             id=self.current_revision.id if self.current_revision else self.id,
--> 205             lang=lang)
    206 
    207     def get_cache_content_key(self, user=None):

TypeError: non-empty format string passed to object.__format__
benjaoming added a commit to atombrella/django-wiki that referenced this issue Dec 30, 2019
…and string in cache key. Add test

Flake8: Ignore line-breaks around binary operators
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.