@@ -247,7 +247,7 @@ def make_published(self, request, queryset):
247247 ) % updated , messages .SUCCESS )
248248 # todo refactor when upgrading to django 3.2 as action decorator
249249 make_published .short_description = "Publish selected annotations"
250- make_published .allowed_permissions = ('annotation_publish ' ,)
250+ make_published .allowed_permissions = ('publish ' ,)
251251
252252 # @admin_.action(description='Publish selected annotations')
253253 def make_unpublished (self , request , queryset ):
@@ -259,12 +259,12 @@ def make_unpublished(self, request, queryset):
259259 ) % updated , messages .SUCCESS )
260260 # todo refactor when upgrading to django 3.2 as action decorator
261261 make_unpublished .short_description = "Unpublish selected annotations"
262- make_unpublished .allowed_permissions = ('annotation_publish ' ,)
262+ make_unpublished .allowed_permissions = ('publish ' ,)
263263
264- def has_annotation_publish_permission (self , request ):
264+ def has_publish_permission (self , request ):
265265 """Does the user have the publish permission?"""
266266 opts = self .opts
267- codename = get_permission_codename ('annotation_publish ' , opts )
267+ codename = get_permission_codename ('publish ' , opts )
268268 return request .user .has_perm ('%s.%s' % (opts .app_label , codename ))
269269
270270 def export_as_csv (self , request , queryset ):
@@ -300,11 +300,13 @@ def export_as_csv(self, request, queryset):
300300 r .data
301301 ])
302302 return response
303+ export_as_csv .short_description = "Export selected annotations"
304+ export_as_csv .allowed_permissions = ('export' ,)
303305
304- def has_annotation_export_permission (self , request ):
306+ def has_export_permission (self , request ):
305307 """Does the user have the publish permission?"""
306308 opts = self .opts
307- codename = get_permission_codename ('annotation_export ' , opts )
309+ codename = get_permission_codename ('export ' , opts )
308310 return request .user .has_perm ('%s.%s' % (opts .app_label , codename ))
309311
310312class CategoryAdminForm (TranslatableModelForm ):
0 commit comments