Skip to content

Commit

Permalink
fixed an issue ignoring last row in table
Browse files Browse the repository at this point in the history
  • Loading branch information
eriktelepovsky committed Jan 28, 2015
1 parent b8c4ed8 commit ae96dc4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
# The short X.Y version.
version = '1.1'
# The full version, including alpha/beta/rc tags.
release = '1.1.1'
release = '1.1.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion permissions_widget/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION='1.1.1'
VERSION='1.1.2'
8 changes: 5 additions & 3 deletions permissions_widget/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ def render(self, name, value, attrs=None, choices=()):
permission_types.setdefault(permission_type, [])
permission_types[permission_type].append(permission)

if last_model != model_class or last_app != app:
if row:
table.append(row)
is_app_or_model_different = last_model != model_class or last_app != app
if is_app_or_model_different:
row = dict(model=model_verbose_name, model_class=model_class, app=app, permissions={})

# place permission
Expand All @@ -67,6 +66,9 @@ def render(self, name, value, attrs=None, choices=()):
'name': permission.name,
}

if is_app_or_model_different:
table.append(row)

last_app = app
last_model = model_class

Expand Down

0 comments on commit ae96dc4

Please sign in to comment.