Skip to content

Commit

Permalink
delete commment
Browse files Browse the repository at this point in the history
Delete for unnecessary
  • Loading branch information
FiorellaBonilla committed Sep 22, 2023
1 parent 1be668c commit e5ab113
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 36 deletions.
25 changes: 2 additions & 23 deletions djgentelella/permissions.py → demo/demoapp/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ def add_related_permission(main_permission_codename, related_permissions):
return True
return False

#add test
#related_permissions = {
# 'app_label': 'auth',
# 'name': 'Can delete user',
# 'codename': 'delete_user',
#}

#if add_related_permission('change_abcde', related_permissions):
# print("Related permission added successfully.")
#else:
# print("Parent permission not found to add related permission.")



Expand All @@ -70,12 +59,7 @@ def remove_related_permission(app_label, main_permission_codename, related_permi
permission['related_permissions'] = updated_related_permissions
return True

#delete test
#result_remove = remove_related_permission('demoapp', 'add_abcde', 'add_session')
#if result_remove:
# print("Related permission successfully removed.")
#else:
# print("Related permission not found for delete.")



#update permissions
Expand All @@ -95,9 +79,4 @@ def update_related_permission(app_label, main_permission_codename, related_permi

return False

# update test
#result_update = update_related_permission('demoapp', 'change_abcde', 'add_user', 'Can view user', 'view_user')
#if result_update:
# print("Related permission successfully updated.")
#else:
# print("Related permission not found for update.")

1 change: 0 additions & 1 deletion djgentelella/permission_management/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def get_related_permissions(self, obj):
obj.related_permissions.all().values_list('id', flat=True))

self.find_permission_related(self.list_of_perms)
#self.remove_permisssion()
list_of_perms = Permission.objects.filter(pk__in=self.list_of_perms)
return PermissionSerializer(list_of_perms, many=True).data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,7 @@ <h4>{% trans 'Permission Type' %}</h4>
</div>
</div>
<div class="col-md-5" id="permissionbody" style="max-height:200px; overflow-y: auto;">
{% for key, value in categories.items %}
<h4><a class="btn categories" data-bs-toggle="collapse" data-bs-target="#category{{key|cut:' '}}"><i class="fa fa-plus"></i></a> {{key}}</h4>
<div id="category{{key|cut:' '}}" class="collapse" style="width:100%">
{% for item in value %}
<div class="row" style="margin-left: 12%;">
<p>{{ item.name }}</p>
<input type="checkbox" class="flat" name="permission" value="{{item.id}}" style="position: absolute; opacity: 0; right: 0;">
</div>
{% endfor %}
</div>
<br>
{% endfor %}

</div>
<div class="col-md-2" style="margin-top: 20px;">
<small>{% trans 'User Permissions' %}</small>
Expand Down
Empty file added djgentelella/tests/API_test.py
Empty file.

0 comments on commit e5ab113

Please sign in to comment.