diff --git a/docs/conf.py b/docs/conf.py index 80596a2..90d4215 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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. diff --git a/permissions_widget/__init__.py b/permissions_widget/__init__.py index bdd0f3f..b1fad51 100644 --- a/permissions_widget/__init__.py +++ b/permissions_widget/__init__.py @@ -1 +1 @@ -VERSION='1.1.1' +VERSION='1.1.2' diff --git a/permissions_widget/forms.py b/permissions_widget/forms.py index c0de71d..0a6f6b3 100644 --- a/permissions_widget/forms.py +++ b/permissions_widget/forms.py @@ -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 @@ -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