Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4135c91b
authored
Feb 21, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
school: trim whitespace on NETPUNK codes
parent
8614fc2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
school/views.py
+2
-2
No files found.
school/views.py
View file @
4135c91b
...
@@ -183,7 +183,7 @@ def group_new(request):
...
@@ -183,7 +183,7 @@ def group_new(request):
members_list
=
re
.
split
(
'
\r
?
\n
'
,
request
.
POST
[
'members'
])
members_list
=
re
.
split
(
'
\r
?
\n
'
,
request
.
POST
[
'members'
])
members
=
[]
members
=
[]
for
member
in
members_list
:
for
member
in
members_list
:
if
re
.
match
(
'^[a-zA-Z][a-zA-Z0-9]{5}$'
,
member
)
==
None
:
if
re
.
match
(
'^[a-zA-Z][a-zA-Z0-9]{5}$'
,
member
.
strip
()
)
==
None
:
messages
.
error
(
request
,
_
(
'Invalid NEPTUN code found.'
))
messages
.
error
(
request
,
_
(
'Invalid NEPTUN code found.'
))
return
redirect
(
'/'
)
return
redirect
(
'/'
)
person
,
created
=
Person
.
objects
.
get_or_create
(
code
=
member
)
person
,
created
=
Person
.
objects
.
get_or_create
(
code
=
member
)
...
@@ -203,7 +203,7 @@ def group_new(request):
...
@@ -203,7 +203,7 @@ def group_new(request):
def
group_ajax_add_new_member
(
request
,
gid
):
def
group_ajax_add_new_member
(
request
,
gid
):
group
=
get_object_or_404
(
Group
,
id
=
gid
)
group
=
get_object_or_404
(
Group
,
id
=
gid
)
member
=
request
.
POST
[
'neptun'
]
member
=
request
.
POST
[
'neptun'
]
if
re
.
match
(
'^[a-zA-Z][a-zA-Z0-9]{5}$'
,
member
)
==
None
:
if
re
.
match
(
'^[a-zA-Z][a-zA-Z0-9]{5}$'
,
member
.
strip
()
)
==
None
:
status
=
json
.
dumps
({
'status'
:
'Error'
})
status
=
json
.
dumps
({
'status'
:
'Error'
})
messages
.
error
(
request
,
_
(
'Invalid NEPTUN code'
))
messages
.
error
(
request
,
_
(
'Invalid NEPTUN code'
))
return
HttpResponse
(
status
)
return
HttpResponse
(
status
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment