Opened 5 years ago

Closed 5 years ago

#30620 closed Cleanup/optimization (fixed)

A full example in documentation is not PEP8 compliant.

Reported by: Nuno Owned by: Nuno
Component: Documentation Version: dev
Severity: Normal Keywords: documentation PEP8
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

This is the smallest of issues, but nevertheless here it goes:

There's one line break missing at line https://github.com/django/django/blob/master/docs/topics/auth/customizing.txt#L1172, so that the example code is PEP8 compliant.

I would be happy to submit my very first PR if that's ok.

Change History (4)

comment:1 by Mariusz Felisiak, 5 years ago

Summary: Code example in documentation not PEP8 compliantA full example in documentation is not PEP8 compliant.
Triage Stage: UnreviewedAccepted
Version: 2.2master

Thanks for this report. Normally we don't restrict all PEP8 rules in examples, e.g. in most of cases we don't put 2 blank lines before class definition. In this case we have a full example that can be copy & paste, so we can make it PEP8 compliant, for that please fix also add_fieldsets:

diff --git a/docs/topics/auth/customizing.txt b/docs/topics/auth/customizing.txt
index daec10c28e..7d287051d8 100644
--- a/docs/topics/auth/customizing.txt
+++ b/docs/topics/auth/customizing.txt
@@ -1162,13 +1162,14 @@ code would be required in the app's ``admin.py`` file::
         add_fieldsets = (
             (None, {
                 'classes': ('wide',),
-                'fields': ('email', 'date_of_birth', 'password1', 'password2')}
-            ),
+                'fields': ('email', 'date_of_birth', 'password1', 'password2'),
+            }),
         )
         search_fields = ('email',)
         ordering = ('email',)
         filter_horizontal = ()

comment:2 by Mariusz Felisiak, 5 years ago

Owner: changed from nobody to Nuno
Status: newassigned

comment:3 by Nuno, 5 years ago

Has patch: set

Submitted PR in Github.

Link: PR

comment:4 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 34a88b21:

Fixed #30620 -- Made an example of admin-compliant custom user app pep8 compliant.

Note: See TracTickets for help on using tickets.
Back to Top