Modify

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#11737 closed defect (fixed)

Remove mixed Tab/Space from source

Reported by: Chris W. Owned by: Chris W.
Priority: normal Component: TracPermissionFilterPlugin
Severity: trivial Keywords:
Cc: Trac Release: 0.12

Description

Hi,

I noticed that in line 74 of file tracpermissionfilter.py tabs are used for indentation while the rest of the file uses spaces. The code works (well, I hope, not yet tested...) but it's really confusing when your editor is set to tabs=4 spaces.

I inserted comments in the code snippet below instead of providing a patch file.

    def check_permission(self, action, username, resource, perm):
        _admin = False
        if self.adminmeta:
            if action == 'TRAC_ADMIN':
        return # <-- This line has 2 tabs
            elif 'TRAC_ADMIN' in perm:
                _admin = True # <-- This line has 16 spaces
        if self.blacklist and len(self.blacklist) != 0:
            if not _admin and action in self.blacklist:
                return False
        if self.whitelist and len(self.whitelist) != 0:
            if not _admin and action not in self.whitelist:
                return False
        return

Attachments (0)

Change History (2)

comment:1 Changed 5 months ago by rjollos

  • Resolution set to fixed
  • Status changed from new to closed

In 13912:

Fixed indentation and replaced tabs with spaces. Fixes #11737.

comment:2 Changed 5 months ago by rjollos

  • Owner changed from sto to Chris W.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.