Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Abi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lloyd Meins
AlekSIS-App-Abi
Commits
f5160481
Verified
Commit
f5160481
authored
3 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Catch DoesNotExist for profile if not permitted
parent
711015cd
No related branches found
No related tags found
No related merge requests found
Pipeline
#34179
passed
3 years ago
Stage: test
Stage: build
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/abi/views.py
+5
-1
5 additions, 1 deletion
aleksis/apps/abi/views.py
with
5 additions
and
1 deletion
aleksis/apps/abi/views.py
+
5
−
1
View file @
f5160481
from
django.contrib
import
messages
from
django.core.exceptions
import
PermissionDenied
from
django.db.models
import
Count
from
django.forms
import
modelformset_factory
from
django.http
import
HttpResponse
...
...
@@ -232,7 +233,10 @@ class ProfileView(PermissionRequiredMixin, AdvancedEditView):
def
get_object
(
self
,
queryset
=
None
):
qs
=
queryset
or
self
.
get_queryset
()
abi_person
=
AbiPerson
.
objects
.
get
(
person
=
self
.
request
.
user
.
person
)
try
:
abi_person
=
AbiPerson
.
objects
.
get
(
person
=
self
.
request
.
user
.
person
)
except
AbiPerson
.
DoesNotExist
:
raise
PermissionDenied
()
obj
=
qs
.
get_or_create
(
person
=
abi_person
)[
0
]
self
.
object
=
obj
objs
=
ProfileFieldValue
.
objects
.
filter
(
profile
=
obj
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment