nephila / djangocms-blog

django CMS blog application - Support for multilingual posts, placeholders, social network meta tags and configurable apphooks
https://djangocms-blog.readthedocs.io
BSD 3-Clause "New" or "Revised" License
403 stars 190 forks source link

FIX: Unicode chars in urls #654

Closed pierreben closed 3 years ago

pierreben commented 3 years ago

Handle unicode chars in reverse of Post and Category models, using Django path() method instead of url()

Closes #653

Description

Allow to reverse blog Post and Category models urls using the Django path method instead of url. A bug appeared in v1.2.0 when migrating from url() to path() when resolving slugs with unicode chars as Django path converters only accepts ASCII letters or numbers, plus the hyphen and underscore characters and no unicode chars.

I suggest to use an str path instead of a slug path for urls to reverse properly.

References

Provide any github issue fixed (as in Fix #XYZ)

Checklist

codecov[bot] commented 3 years ago

Codecov Report

Merging #654 (eab362e) into develop (83e76f1) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #654   +/-   ##
========================================
  Coverage    94.69%   94.69%           
========================================
  Files           21       21           
  Lines         1112     1112           
  Branches       138      138           
========================================
  Hits          1053     1053           
  Misses          21       21           
  Partials        38       38           
Flag Coverage Δ
unittests 94.69% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
djangocms_blog/settings.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 83e76f1...eab362e. Read the comment docs.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.06%) to 97.07% when pulling eab362ef413bf2253f239abc274b6d0cd6221972 on pierreben:bugfix/issue-653-fix-accents-path-slug into 83e76f1fe2aa531784dbe33daa152f7c1011450d on nephila:develop.

yakky commented 3 years ago

@pierreben thanks for this PR I just gave it a quick look and it looks ok I will check it more thoroughly shortly and

pierreben commented 3 years ago

Many thanks for the approval an all the work you're doing on cms-blog !