Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pvk-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
amiv
pvk-tool
Commits
74220165
Commit
74220165
authored
Dec 03, 2017
by
Alexander Dietmüller
Committed by
adietmue
Mar 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backend: Selections are now the same format as signups for easier handling.
parent
8d9feeb7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
16 deletions
+14
-16
Backend/settings.py
Backend/settings.py
+11
-13
Backend/tests/test_resources.py
Backend/tests/test_resources.py
+1
-1
Backend/tests/test_security.py
Backend/tests/test_security.py
+2
-2
No files found.
Backend/settings.py
View file @
74220165
...
...
@@ -190,7 +190,7 @@ DOMAIN = {
'selections'
:
{
# Easy way for users to safe their selections before signup is open
#
List of selected courses per user
#
exactly like singups, but without status
'user_methods'
:
[
'GET'
,
'POST'
,
'PATCH'
,
'DELETE'
],
...
...
@@ -202,20 +202,18 @@ DOMAIN = {
'nullable'
:
False
,
'required'
:
True
,
'only_own_nethz'
:
True
,
'
unique'
:
True
,
'
not_patchable'
:
True
,
# Signup is tied to user
},
'courses'
:
{
'type'
:
'list'
,
'schema'
:
{
'type'
:
'objectid'
,
'data_relation'
:
{
'resource'
:
'courses'
,
'field'
:
'_id'
,
'embeddable'
:
True
},
# TODO: No duplicate entries
# TODO: No entries that are already reserved
'course'
:
{
'type'
:
'objectid'
,
'data_relation'
:
{
'resource'
:
'courses'
,
'field'
:
'_id'
,
'embeddable'
:
True
},
'unique_combination'
:
[
'nethz'
],
'required'
:
True
,
# TODO: No overlapping courses
},
},
},
...
...
Backend/tests/test_resources.py
View file @
74220165
...
...
@@ -37,7 +37,7 @@ def test_create(app):
selection
=
{
'nethz'
:
'Pablito'
,
'course
s'
:
[
course_response
[
'_id'
]
]
'course
'
:
course_response
[
'_id'
]
}
app
.
client
.
post
(
'selections'
,
data
=
selection
,
assert_status
=
201
)
...
...
Backend/tests/test_security.py
View file @
74220165
...
...
@@ -101,7 +101,7 @@ def test_selection_own_nethz(app):
# Try with other nethz
bad_selection
=
{
'nethz'
:
'Notthenethz'
,
'course
s'
:
[
course
]
,
'course
'
:
course
,
}
app
.
client
.
post
(
'/selections'
,
data
=
bad_selection
,
...
...
@@ -110,7 +110,7 @@ def test_selection_own_nethz(app):
# Try with own nethz
good_selection
=
{
'nethz'
:
nethz
,
'course
s'
:
[
course
]
,
'course
'
:
course
,
}
app
.
client
.
post
(
'/selections'
,
data
=
good_selection
,
...
...
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