stephenmcd / mezzanine

CMS framework for Django
http://mezzanine.jupo.org
BSD 2-Clause "Simplified" License
4.75k stars 1.64k forks source link

[BUG] Missing comma from fieldset "fields" value #2013

Closed code-review-doctor closed 2 years ago

code-review-doctor commented 2 years ago

Is there an existing issue for this?

Current Behavior

Missing comma from fieldset "fields" value on line 471:

https://github.com/stephenmcd/mezzanine/blob/b407cb70ff66684e0511b827234e103259a91d4c/tests/test_core.py#L468-L472

this results in the fieldset fields being a str rather than a tuple (a single item tuple requires a comma otherwise python willn not know it's a tuple. It's a comma that makes the tuple, not paren).

Funnily enough - the reason the tests pass is the field name is a single character "c", so when Django loops over the string, it finds one item: "c".If the field name had two chars then the bug would present itself.

Expected Behavior

fieldset fields should be a tuple like so

     ("Fieldset 3", {"fields": ("c",)}), 

Steps To Reproduce

NA

Environment

NA

Anything else?

I am a static analysis tool, and found this issue while integration testing new checks against various codebases - this one included.

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 5.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: