Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rights Engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
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
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Polaris
Rights Engine
Commits
03fe90c1
Commit
03fe90c1
authored
2 months ago
by
Lennard Strohmeyer
Browse files
Options
Downloads
Patches
Plain Diff
#109
fixed test case and added correct filter for consents
parent
b3291453
No related branches found
Branches containing commit
Tags
v1.0.1.rc6
Tags containing commit
No related merge requests found
Pipeline
#1591938
passed
2 months ago
Stage: test
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/consents/tests/tests_consent_operations.py
+5
-3
5 additions, 3 deletions
src/consents/tests/tests_consent_operations.py
src/xapi/views.py
+1
-1
1 addition, 1 deletion
src/xapi/views.py
with
6 additions
and
4 deletions
src/consents/tests/tests_consent_operations.py
+
5
−
3
View file @
03fe90c1
...
...
@@ -878,16 +878,18 @@ class TestUserConsentSaveUpdatedProviderSchema(BaseTestCase):
)
self
.
assertEqual
(
response
.
status_code
,
200
)
user_consents
=
UserConsents
.
objects
.
filter
(
user__email
=
self
.
test_user_email
)
user_consents
=
UserConsents
.
objects
.
filter
(
user__email
=
self
.
test_user_email
,
active
=
True
)
self
.
assertEqual
(
len
(
user_consents
),
2
)
self
.
assertTrue
(
UserConsents
.
objects
.
get
(
verb
=
"
http://h5p.example.com/expapi/verbs/experienced
"
verb
=
"
http://h5p.example.com/expapi/verbs/experienced
"
,
active
=
True
).
consented
)
self
.
assertTrue
(
UserConsents
.
objects
.
get
(
verb
=
"
http://h5p.example.com/expapi/verbs/attempted
"
verb
=
"
http://h5p.example.com/expapi/verbs/attempted
"
,
active
=
True
).
consented
)
...
...
This diff is collapsed.
Click to expand it.
src/xapi/views.py
+
1
−
1
View file @
03fe90c1
...
...
@@ -195,7 +195,7 @@ def process_statement(x_api_statement, provider, latest_schema):
# has the user given consent to this verb?
# maybe TODO: load correct provider schema pertaining to this user consent to validate the verb and objects fully
user_consent
=
UserConsents
.
objects
.
filter
(
user
=
user
,
provider
=
provider
,
verb
=
verb
,
consented
=
True
,
created__lte
=
timestamp
user
=
user
,
provider
=
provider
,
verb
=
verb
,
consented
=
True
,
created__lte
=
timestamp
,
active
=
True
).
first
()
if
not
user_consent
:
...
...
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