improve dicom uploading

This commit is contained in:
Ross
2023-10-23 13:36:41 +01:00
parent c786019af1
commit 0f3bc68de6
28 changed files with 464 additions and 172 deletions
+2
View File
@@ -20,6 +20,8 @@ class UserListFilter(django_filters.FilterSet):
"username": ["contains"],
"email": ["contains"],
"userprofile__grade": ["exact"],
"userprofile__peninsula_trainee": ["exact"],
}
# def __init__(self, data=None, queryset=None, *, request=None, prefix=None):
+18 -2
View File
@@ -73,7 +73,7 @@ a:link {
font-size: 20;
}
.hide {
.hide, .hidden {
display: none;
}
@@ -712,7 +712,8 @@ input {
text-decoration: underline;
}
.date,.small-gray {
.date,
.small-gray {
font-size: smaller;
opacity: 50%;
}
@@ -1039,4 +1040,19 @@ h6 {
background-color: black;
width: 100%;
}
table .peninsula-trainee::before {
content: "Trainee";
transform: rotate(-90deg) translate(-45px, -10px);
color: darkblue;
display: inline-block;
float: left;
width: 20px;
}
#series-list .selected {
color: white;
background-color: #52057b;
user-select: none;
}
+29 -1
View File
@@ -600,7 +600,7 @@ class UpdateUserView(CidManagerRequiredMixin, UpdateView):
return reverse(view_name, kwargs={"slug": self.object.username})
class UpdateUserProfileView(CidManagerRequiredMixin, UpdateView):
class UpdateUserProfileAdminView(CidManagerRequiredMixin, UpdateView):
model = UserProfile
fields = [
"supervisor",
@@ -617,6 +617,34 @@ class UpdateUserProfileView(CidManagerRequiredMixin, UpdateView):
# No need for reverse_lazy here, because it's called inside the method
return reverse(view_name, kwargs={"slug": self.object.username})
class UpdateUserProfileView(UpdateView):
model = UserProfile
fields = [
"supervisor",
"grade",
"registration_number",
#"peninsula_trainee",
] # Keep listing whatever fields
template_name = "user_update_profile.html"
slug_field = "user__username"
slug_url_kwarg = "slug"
def dispatch(self, request, *args, **kwargs):
if request.user.is_superuser or request.user.groups.filter(name="cid_user_manager").exists():
self.fields = ["supervisor", "grade", "registration_number", "peninsula_trainee"]
# Check permissions for the request.user here
elif request.user.userprofile.peninsula_trainee:
self.fields = ["supervisor", "grade", "registration_number"]
else:
self.fields = ["grade", "registration_number"]
return super().dispatch(request, *args, **kwargs)
def get_success_url(self):
view_name = "account_profile"
# No need for reverse_lazy here, because it's called inside the method
return reverse(view_name, kwargs={"slug": self.object.username})
# class UpdateUser(TemplateView):
#