mirror of
https://github.com/leaders-of-digital-9-task/backend.git
synced 2024-11-24 18:23:46 +03:00
minor changes
This commit is contained in:
parent
8c25cacc76
commit
1e8c57efaf
|
@ -206,7 +206,12 @@ class ListUpdateDicomImageNumberApi(GenericAPIView):
|
|||
|
||||
|
||||
class ListCreateProjectApi(generics.ListCreateAPIView):
|
||||
serializer_class = ListProjectSerializer
|
||||
def get_serializer_class(self):
|
||||
if self.request.user.is_staff:
|
||||
s = ListProjectSerializer
|
||||
s.Meta.fields.append("user_username")
|
||||
return s
|
||||
return ListProjectSerializer
|
||||
|
||||
def get_queryset(self):
|
||||
if self.request.user.is_staff:
|
||||
|
|
|
@ -62,6 +62,10 @@ class Project(models.Model):
|
|||
def __str__(self):
|
||||
return f"{self.user.username}'s project"
|
||||
|
||||
@property
|
||||
def user_username(self):
|
||||
return self.user.username
|
||||
|
||||
|
||||
class Dicom(models.Model):
|
||||
slug = models.SlugField()
|
||||
|
|
Loading…
Reference in New Issue
Block a user