SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
b0b989a8
Commit
b0b989a8
authored
9 months ago
by
George Katsikas
Browse files
Options
Downloads
Patches
Plain Diff
fix users unable to add own profile emails
parent
762851fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scipost_django/profiles/views.py
+9
-1
9 additions, 1 deletion
scipost_django/profiles/views.py
with
9 additions
and
1 deletion
scipost_django/profiles/views.py
+
9
−
1
View file @
b0b989a8
...
@@ -429,12 +429,20 @@ def _hx_profile_specialties(request, profile_id):
...
@@ -429,12 +429,20 @@ def _hx_profile_specialties(request, profile_id):
return
render
(
request
,
"
profiles/_hx_profile_specialties.html
"
,
context
)
return
render
(
request
,
"
profiles/_hx_profile_specialties.html
"
,
context
)
@permission_required_htmx
(
"
scipost.can_add_profile_emails
"
)
def
_hx_add_profile_email
(
request
,
profile_id
):
def
_hx_add_profile_email
(
request
,
profile_id
):
"""
"""
Add an email address to a Profile.
Add an email address to a Profile.
"""
"""
profile
=
get_object_or_404
(
Profile
,
pk
=
profile_id
)
profile
=
get_object_or_404
(
Profile
,
pk
=
profile_id
)
is_self_profile
=
request
.
user
.
contributor
.
profile
==
profile
can_add_any_emails
=
request
.
user
.
has_perm
(
"
scipost.can_add_profile_emails
"
)
if
not
(
is_self_profile
or
can_add_any_emails
):
return
HTMXResponse
(
"
You do not have the required permissions to add an email to this profile.
"
,
tag
=
"
danger
"
,
)
form
=
AddProfileEmailForm
(
form
=
AddProfileEmailForm
(
request
.
POST
or
None
,
request
.
POST
or
None
,
profile
=
profile
,
profile
=
profile
,
...
...
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