Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • j.michal/grady
1 result
Show changes
Commits on Source (2)
......@@ -10,6 +10,8 @@ from core.models import TutorSubmissionAssignment
from core.permissions import IsReviewer, IsTutorOrReviewer
from core.serializers import AssignmentDetailSerializer, AssignmentSerializer
from multiprocessing import Lock
log = logging.getLogger(__name__)
......@@ -123,11 +125,13 @@ class AssignmentApiViewSet(
@permission_classes((IsTutorOrReviewer,))
def create(self, request, *args, **kwargs):
context = self.get_serializer_context()
serializer = AssignmentDetailSerializer(data=request.data,
context=context)
serializer.is_valid(raise_exception=True)
return self._fetch_assignment(serializer)
with Lock():
context = self.get_serializer_context()
serializer = AssignmentDetailSerializer(data=request.data,
context=context)
serializer.is_valid(raise_exception=True)
assignment = self._fetch_assignment(serializer)
return assignment
@permission_classes((IsTutorOrReviewer,))
def retrieve(self, request, *args, **kwargs):
......
......@@ -3,7 +3,7 @@ sleep 1
python manage.py migrate --noinput
gunicorn \
--bind 0.0.0.0:8000 \
--workers=2 \
--worker-class=gevent \
--workers=5 \
--worker-class=sync \
--log-level debug \
grady.wsgi:application
......@@ -77,10 +77,15 @@ export default {
})
this.$emit('hide')
}).catch(() => {
let reasons = ''
if (error.response) {
reasons = error.response.data.password.map(reason => `- ${reason}`).join('<br/>')
}
this.$notify({
title: 'Error!',
text: 'Unable to change password',
type: 'error'
text: `Unable to change password<br/>${reasons}`,
type: 'error',
duration: -1
})
})
}
......
......@@ -58,11 +58,17 @@ export default {
this.loading = true
registerTutor(this.credentials).then(() => {
this.$emit('registered', this.credentials)
}).catch(() => {
}).catch(error => {
let reasons = ''
if (error.response) {
reasons = error.response.data.password.map(reason => `- ${reason}`).join('<br/>')
}
console.log(reasons)
this.$notify({
title: 'Unable to register',
text: "Couldn't register a tutor account.",
type: 'error'
text: `Couldn't register a tutor account.<br/>${reasons}`,
type: 'error',
duration: -1
})
}).finally(() => { this.loading = false })
}
......
<template>
<v-card>
<v-card-title class="title">Assignment types</v-card-title>
<v-card-title class="title">Task types</v-card-title>
<v-layout row wrap>
<v-flex xs3>
<v-list>
......@@ -16,7 +16,7 @@
</v-flex>
<v-flex xs9>
<v-layout v-if="!selectedSubmissionType" justify-center>
<strong>Select an assignment type on the left to see the description and solution.</strong>
<strong>Select a task type on the left to see the description and solution.</strong>
</v-layout>
<submission-type class="mr-2 mb-2" v-else v-bind="selectedSubmissionType"/>
</v-flex>
......
......@@ -8,11 +8,11 @@
<!-- dynamically set css class depending on active -->
<v-list-tile-content
:class="{'inactive-subscription': !active}"
class="ml-3">
class="mr-3 subscription">
{{name}}
</v-list-tile-content>
<v-list-tile-action-text>
available: {{available}}
left: {{available}}
</v-list-tile-action-text>
</v-list-tile>
</v-layout>
......@@ -55,4 +55,10 @@ export default class SubscriptionForList extends Vue {
cursor: default;
color: #B5B5B5;
}
.subscription {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
......@@ -5,7 +5,6 @@ djangorestframework~=3.8
git+https://github.com/robinhundt/djangorestframework-camel-case
Django~=2.1
drf-yasg~=1.12.0
gevent~=1.3.0
gunicorn~=19.9.0
psycopg2-binary~=2.7.0
python-json-logger~=0.1.0
......