Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
warpinfra
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Sebastian
warpinfra
Commits
0750e310
Commit
0750e310
authored
8 years ago
by
Christian Dresen
Browse files
Options
Downloads
Patches
Plain Diff
[WarpAuth] Fixed missing card id error while changing profile ids
parent
d2d4e629
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
www/web/warpauth/templates/warpauth/profile/information.html
+1
-1
1 addition, 1 deletion
www/web/warpauth/templates/warpauth/profile/information.html
www/web/warpauth/views/profile.py
+16
-4
16 additions, 4 deletions
www/web/warpauth/views/profile.py
with
17 additions
and
5 deletions
www/web/warpauth/templates/warpauth/profile/information.html
+
1
−
1
View file @
0750e310
...
...
@@ -7,7 +7,7 @@
<div
class=
"panel panel-default"
>
<div
class=
"panel-body"
>
{% if error_info %}
<div
class=
"alert alert-danger"
>
{
{
error_info
}
}
</div><br>
<div
class=
"alert alert-danger"
>
{
% trans
error_info
%
}
</div><br>
{% endif %}
{% if success_info %}
<div
class=
"alert alert-success"
>
{% trans "information_changed_successfully" %}
</div><br>
...
...
This diff is collapsed.
Click to expand it.
www/web/warpauth/views/profile.py
+
16
−
4
View file @
0750e310
...
...
@@ -44,16 +44,28 @@ def change_information(request):
if
request
.
method
!=
'
POST
'
:
return
redirect
(
"
profile_index
"
)
user
=
LdapUser
.
objects
.
get
(
uid
=
str
(
request
.
user
))
first_name
=
request
.
POST
[
"
first_name
"
]
last_name
=
request
.
POST
[
"
last_name
"
]
if
"
first_name
"
in
request
.
POST
:
first_name
=
request
.
POST
[
"
first_name
"
]
if
"
last_name
"
in
request
.
POST
:
last_name
=
request
.
POST
[
"
last_name
"
]
if
"
card_id
"
in
request
.
POST
:
card_id
=
request
.
POST
[
"
card_id
"
]
else
:
card_id
=
0
if
"
email
"
not
in
request
.
POST
:
page_context
[
"
error_info
"
]
=
"
err_invalid_email
"
return
HttpResponse
(
render
(
request
,
'
warpauth/profile.html
'
,
page_context
))
email
=
request
.
POST
[
"
email
"
]
card_id
=
request
.
POST
[
"
card_id
"
]
f
=
forms
.
EmailField
()
try
:
f
.
clean
(
email
)
except
ValidationError
as
e
:
page_context
[
"
error_info
"
]
=
"
I
nvalid
E
mail
"
page_context
[
"
error_info
"
]
=
"
err_i
nvalid
_e
mail
"
return
HttpResponse
(
render
(
request
,
'
warpauth/profile.html
'
,
page_context
))
cn
=
first_name
+
"
"
+
last_name
cn
=
cn
.
strip
()
...
...
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