Skip to content

Commit

Permalink
Minor changes, admin and Readme change
Browse files Browse the repository at this point in the history
  • Loading branch information
broekhuisg committed Jul 5, 2022
1 parent b670133 commit bc2c8ce
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,14 @@ docker-compose exec [container_name] [command]
```
docker-compose exec backend python manage.py migrate
```

## Admin

To see the data that is saved in the database, you can take a look in the admin.
To do so, you have to create a local superuseraccount:

```
docker-compose exec backend python manage.py createsuperuser
```

After finishing all the steps, you can login on localhost:8000/admin
3 changes: 3 additions & 0 deletions backend/holon/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from django.contrib import admin

from holon.models import UpdateRegister

# Register your models here.
admin.site.register(UpdateRegister)
19 changes: 1 addition & 18 deletions backend/holon/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,9 @@

class AllowOnlyPost(permissions.BasePermission):

edit_methods = ("PUT", "PATCH")

def has_permission(self, request, view):
if request.user.is_authenticated:
return True

if request.method == 'POST':
return True

# def has_object_permission(self, request, view, obj):
# if request.user.is_superuser:
# return True

# if request.method in permissions.SAFE_METHODS:
# return True

# if obj.author == request.user:
# return True

# if request.user.is_staff and request.method not in self.edit_methods:
# return True

# return False
return True

0 comments on commit bc2c8ce

Please sign in to comment.