Commit 34f85f26 authored by Benoit Alessandroni's avatar Benoit Alessandroni

Merge branch 'master' into feature/ifram-video

parents e1d1969a f60b4d6d
......@@ -79,6 +79,15 @@ python manage.py migrate
And run the loaddata command once more.
If you get a error message like : `django.db.utils.OperationalError: no such table: coopstarter_data_mymissingtable, please run :
`
```
python3 manage.py migrate --run-syncdb
```
## OpenIDConnect configuration
This server uses the [Django OIDC provider](https://django-oidc-provider.readthedocs.io/en/latest/sections/installation.html) library to allow distributed authentication.
......
"""djangoldp project URL Configuration"""
from django.conf.urls import url
from .views import PendingResourcesViewSet
from .views import ValidatedResourcesByStepViewSet
urlpatterns = [
url(r'^steps/(?P<id>.+)/resources/validated/', ValidatedResourcesByStepViewSet.urls(model_prefix="resources-validated")),
url(r'^resources/pending/', PendingResourcesViewSet.urls(model_prefix="resources-pending")),
]
\ No newline at end of file
[
{
"model": "coopstarter_data.country",
"pk": 1,
"fields": {
"name": "France",
"code": "AF"
}
},
{
"model": "coopstarter_data.country",
"pk": 2,
"fields": {
"name": "United Kingdom",
"code": "GB"
}
}
]
......@@ -12,7 +12,16 @@
"organisation": 3,
"user": 1,
"languages": [
1
1,
2
],
"fields": [
3,
4,
5,
6,
7,
8
]
}
},
......@@ -29,7 +38,15 @@
"organisation": 2,
"user": 2,
"languages": [
1,
2
],
"fields": [
1,
2,
9,
6,
5
]
}
}
......
......@@ -5,7 +5,7 @@
"name":"Resource request",
"description":"I'd like to see a resource about the unknown topic of field 2 and 7",
"language":1,
"country":"FR",
"country":1,
"skills":"Organisation and more efficiency while coding the thing",
"organisation": 2,
"submitter":1,
......@@ -22,7 +22,7 @@
"name":"Resource request 2",
"description":"I'd like to see a resource about the unknown topic of field 3 and 4",
"language":2,
"country":"EN",
"country":2,
"skills":"Organisation and more efficiency while coding the thing",
"organisation": 2,
"submitter":1,
......@@ -39,7 +39,7 @@
"name":"Resource request 3",
"description":"I'd like to see a resource about the unknown topic of field 1 and 5",
"language":1,
"country":"FR",
"country":1,
"skills":"Organisation and more efficiency while coding the thing",
"organisation": 1,
"submitter":1,
......
......@@ -5,19 +5,18 @@
"name":"Value proposition design",
"publication_year":2000,
"language":1,
"country":"FR",
"country":1,
"uri":"https://www.strategyzer.com/books/value-proposition-design",
"author":"Alex Osterwalder",
"skills":"Is vulputate. Aliquam mollis consectetur enim, et aliquet lorem. Fusce quis placerat urna. Vestibulum pharetra rhoncus felis at mollis. Mauris purus diam, iaculis at massa vel, lacinia sollicitudin mauris. Nullam ultricies, ligula quis varius aliquam, eros mi ultric",
"description":"Pellentesque urna neque, posuere ac vulputate et, rhoncus ut nisi. Etiam at ligula eget orci viverra fermentum id pellentesque ante.",
"iframe_link":"",
"preview_image":"",
"review": 1,
"target":"public",
"type":1,
"sharing":"public",
"format":[
2
],
"format": 2,
"submitter":1,
"fields":[
7
......@@ -34,7 +33,7 @@
"name":"Business Plan Spreadsheet",
"publication_year":2018,
"language":1,
"country":"FR",
"country":1,
"uri":"https://docs.google.com/spreadsheets/d/1VYNmqo7lm07q5JyKNw5NFf6QMhmhH9osIPjFwjaMipM/",
"author":"Blaise Balaise",
"skills":"Etiam a hendrerit leo. In fermentum quis libero quis vulputate. Aliquam mollis consectetur enim, et aliquet lorem. Fusce quis placerat urna. Vestibulum pharetra rhoncus",
......@@ -43,10 +42,9 @@
"preview_image":"",
"target":"public",
"type":1,
"review": 2,
"sharing":"public",
"format":[
3
],
"format": 3,
"submitter":1,
"fields":[
7
......@@ -63,7 +61,7 @@
"name":"First steps to be a mentor",
"publication_year":2009,
"language":2,
"country":"EN",
"country":2,
"uri":"https://docs.google.com/spreadsheets/d/1VYNmqo7lm07q5JyKNw5NFf6QMhmhH9osIPjFwjaMipM/",
"author":"Benito Blaise",
"skills":"Etiam a hendrerit leo. In fermentum quis libero quis vulputate. Aliquam mollis consectetur enim, et aliquet lorem. Fusce quis placerat urna. Vestibulum pharetra rhoncus",
......@@ -73,9 +71,8 @@
"target":"public",
"type":2,
"sharing":"public",
"format":[
3
],
"format":3,
"review": 3,
"submitter":2,
"fields":[
7,
......@@ -94,7 +91,7 @@
"name":"Cooperative statuses in France",
"publication_year":2003,
"language":2,
"country":"EN",
"country":2,
"uri":"https://docs.google.com/spreadsheets/d/1VYNmqo7lm07q5JyKNw5NFf6QMhmhH9osIPjFwjaMipM/",
"author":"Balzor Troto",
"skills":"Etiam a hendrerit leo. In fermentum quis libero quis vulputate. Aliquam mollis consectetur enim, et aliquet lorem. Fusce quis placerat urna. Vestibulum pharetra rhoncus",
......@@ -104,9 +101,8 @@
"target":"public",
"type":2,
"sharing":"public",
"format":[
4
],
"format":4,
"review": 4,
"submitter":2,
"fields":[
7,
......@@ -125,7 +121,7 @@
"name":"Cooperative governance issue",
"publication_year":2004,
"language":1,
"country":"FR",
"country":1,
"uri":"https://docs.google.com/spreadsheets/d/1VYNmqo7lm07q5JyKNw5NFf6QMhmhH9osIPjFwjaMipM/",
"author":"Vitali Breshko",
"skills":"Etiam a hendrerit leo. In fermentum quis libero quis vulputate. Aliquam mollis consectetur enim, et aliquet lorem. Fusce quis placerat urna. Vestibulum pharetra rhoncus",
......@@ -135,11 +131,8 @@
"target":"public",
"type":1,
"sharing":"public",
"format":[
2,
3,
4
],
"format":4,
"review": 5,
"submitter":2,
"fields":[
1,
......@@ -161,7 +154,7 @@
"name":"Starting a cooperative the good way",
"publication_year":2009,
"language":2,
"country":"EN",
"country":2,
"uri":"https://docs.google.com/spreadsheets/d/1VYNmqo7lm07q5JyKNw5NFf6QMhmhH9osIPjFwjaMipM/",
"author":"Balzor Troto",
"skills":"Etiam a hendrerit leo. In fermentum quis libero quis vulputate. Aliquam mollis consectetur enim, et aliquet lorem. Fusce quis placerat urna. Vestibulum pharetra rhoncus",
......@@ -171,9 +164,8 @@
"target":"public",
"type":2,
"sharing":"public",
"format":[
5
],
"format":5,
"review": 6,
"submitter":2,
"fields":[
1,
......@@ -192,7 +184,7 @@
"name":"Is cooperativism done the right way ?",
"publication_year":2002,
"language":1,
"country":"FR",
"country":1,
"uri":"https://docs.google.com/spreadsheets/d/1VYNmqo7lm07q5JyKNw5NFf6QMhmhH9osIPjFwjaMipM/",
"author":"Sigmund Freud",
"skills":"Etiam a hendrerit leo. In fermentum quis libero quis vulputate. Aliquam mollis consectetur enim, et aliquet lorem. Fusce quis placerat urna. Vestibulum pharetra rhoncus",
......@@ -202,10 +194,8 @@
"target":"mentor",
"type":1,
"sharing":"private",
"format":[
1,
5
],
"format":5,
"review": 7,
"submitter":1,
"fields":[
2,
......@@ -224,7 +214,7 @@
"name":"Is Cooperativism fun ?",
"publication_year":1998,
"language":1,
"country":"FR",
"country":1,
"uri":"https://docs.google.com/spreadsheets/d/1VYNmqo7lm07q5JyKNw5NFf6QMhmhH9osIPjFwjaMipM/",
"author":"Charlie Chaplin",
"skills":"Etiam a hendrerit leo. In fermentum quis libero quis vulputate. Aliquam mollis consectetur enim, et aliquet lorem. Fusce quis placerat urna. Vestibulum pharetra rhoncus",
......@@ -234,11 +224,8 @@
"target":"entrepreneur",
"type":2,
"sharing":"public",
"format":[
1,
2,
3
],
"format":2,
"review": 8,
"submitter":2,
"fields":[
5,
......@@ -259,7 +246,7 @@
"name":"Live the cooperative way",
"publication_year":1997,
"language":1,
"country":"FR",
"country":1,
"uri":"https://docs.google.com/spreadsheets/d/1VYNmqo7lm07q5JyKNw5NFf6QMhmhH9osIPjFwjaMipM/",
"author":"Raymond Zappata",
"skills":"Etiam a hendrerit leo. In fermentum quis libero quis vulputate. Aliquam mollis consectetur enim, et aliquet lorem. Fusce quis placerat urna. Vestibulum pharetra rhoncus",
......@@ -269,10 +256,8 @@
"target":"mentor",
"type":1,
"sharing":"private",
"format":[
4,
5
],
"format":5,
"review": 9,
"submitter":2,
"fields":[
2,
......@@ -291,7 +276,7 @@
"name":"Cooperative meltdown in France",
"publication_year":2003,
"language":1,
"country":"FR",
"country":1,
"uri":"https://docs.google.com/spreadsheets/d/1VYNmqo7lm07q5JyKNw5NFf6QMhmhH9osIPjFwjaMipM/",
"author":"Anorld Schwarz",
"skills":"Etiam a hendrerit leo. In fermentum quis libero quis vulputate. Aliquam mollis consectetur enim, et aliquet lorem. Fusce quis placerat urna. Vestibulum pharetra rhoncus",
......@@ -301,10 +286,8 @@
"target":"mentor",
"type":1,
"sharing":"private",
"format":[
1,
6
],
"format":6,
"review": 10,
"submitter":1,
"fields":[
8,
......@@ -323,7 +306,7 @@
"name":"More cooperative, more friendship",
"publication_year":2004,
"language":2,
"country":"EN",
"country":2,
"uri":"https://docs.google.com/spreadsheets/d/1VYNmqo7lm07q5JyKNw5NFf6QMhmhH9osIPjFwjaMipM/",
"author":"Bozo Elclono",
"skills":"Etiam a hendrerit leo. In fermentum quis libero quis vulputate. Aliquam mollis consectetur enim, et aliquet lorem. Fusce quis placerat urna. Vestibulum pharetra rhoncus",
......@@ -333,10 +316,8 @@
"target":"mentor",
"type":1,
"sharing":"private",
"format":[
4,
2
],
"format":6,
"review": 11,
"submitter":1,
"fields":[
1,
......
[
{
"model": "coopstarter_data.review",
"pk": 1,
"fields": {
"reviewer": 2,
"comment": "It is ok!",
"status": "validated"
}
},
{
"model": "coopstarter_data.review",
"pk": 2,
"fields": {
"reviewer": 2,
"status": "validated"
}
},
{
"model": "coopstarter_data.review",
"pk": 3,
"fields": {
"reviewer": 1,
"status": "validated"
}
},
{
"model": "coopstarter_data.review",
"pk": 4,
"fields": {
"reviewer": 1,
"status": "validated"
}
},
{
"model": "coopstarter_data.review",
"pk": 5,
"fields": {
"reviewer": 1,
"status": "validated"
}
},
{
"model": "coopstarter_data.review",
"pk": 6,
"fields": {
"reviewer": 1,
"status": "validated"
}
},
{
"model": "coopstarter_data.review",
"pk": 7,
"fields": {
"reviewer": 2,
"status": "validated"
}
},
{
"model": "coopstarter_data.review",
"pk": 8,
"fields": {
"reviewer": 1,
"status": "validated"
}
},
{
"model": "coopstarter_data.review",
"pk": 9,
"fields": {
"reviewer": 1,
"status": "validated"
}
},
{
"model": "coopstarter_data.review",
"pk": 10,
"fields": {
"reviewer": 2,
"status": "validated"
}
},
{
"model": "coopstarter_data.review",
"pk": 11,
"fields": {
"reviewer": 2,
"status": "validated"
}
}
]
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Hello {{brokenlink.resource.submitter.name}}
{{brokenlink.submitter.name|safe}} ({{brokenlink.submitter.email}}) is reporting you that the following resource you submit has a broken link :
Title: {{brokenlink.resource.name}}
Description: {{brokenlink.resource.description}}
URI: {{brokenlink.resource.uri}}
Have a nice day,
The Knowledge Base Team.
\ No newline at end of file
Hello {{resource.submitter.name}}
{{review.reviewer.name|safe}} proposed an improvement to the following resource you submitted.
{{review.reviewer.name|safe}} ({{review.reviewer.email}}) proposed an improvement to the following resource you submitted.
Title: {{resource.name}}
......
Hello {{resource.submitter.name}}
{{review.reviewer.name|safe}} did refuse the following resource you submitted.
{{review.reviewer.name|safe}} ({{review.reviewer.email}}) did refuse the following resource you submitted.
Title: {{resource.name}}
......
Hello {{resource.submitter.name}}
{{review.reviewer.name|safe}} did validate the following resource you submitted.
{{review.reviewer.name|safe}} ({{review.reviewer.email}}) did validate the following resource you submitted.
Title: {{resource.name}}
......
from djangoldp.views import LDPViewSet
from .models import Resource
from .models import Resource, Step
class ValidatedResourcesByStepViewSet(LDPViewSet):
model = Resource
def get_queryset(self, *args, **kwargs):
step_id = self.kwargs['id']
return super().get_queryset(*args, **kwargs)\
.filter(steps__in=step_id, review__status='validated')\
.exclude(submitter__username=self.request.user.username)
class PendingResourcesViewSet(LDPViewSet):
model = Resource
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment