Skip to content

Commit

Permalink
Different fixes for Release 0.5.0 (cvat-ai#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored and nmanovic committed Aug 27, 2019
1 parent fbae6bb commit 0c33055
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,11 @@
// This rule actual for user input data on the node.js environment mainly.
"security/detect-object-injection": 0,
"indent": ["warn", 4],
// recently added to airbnb
"max-classes-per-file": [0],
// it was opposite before and our code has been written according to previous rule
"arrow-parens": [0],
// object spread is a modern ECMA standard. Let's do not use it without babel
"prefer-object-spread": [0],
},
};
12 changes: 6 additions & 6 deletions cvat-core/src/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -1307,22 +1307,22 @@
z_order: Boolean(this.zOrder),
};

if (this.bugTracker) {
if (typeof (this.bugTracker) !== 'undefined') {
taskData.bug_tracker = this.bugTracker;
}
if (this.segmentSize) {
if (typeof (this.segmentSize) !== 'undefined') {
taskData.segment_size = this.segmentSize;
}
if (this.overlap) {
if (typeof (this.overlap) !== 'undefined') {
taskData.overlap = this.overlap;
}
if (this.startFrame) {
if (typeof (this.startFrame) !== 'undefined') {
taskData.start_frame = this.startFrame;
}
if (this.stopFrame) {
if (typeof (this.stopFrame) !== 'undefined') {
taskData.stop_frame = this.stopFrame;
}
if (this.frameFilter) {
if (typeof (this.frameFilter) !== 'undefined') {
taskData.frame_filter = this.frameFilter;
}

Expand Down
13 changes: 11 additions & 2 deletions cvat/apps/dashboard/static/dashboard/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,16 @@ class DashboardView {

let tasks = null;
try {
tasks = await window.cvat.tasks.get(Object.assign({}, {
const id = (new URLSearchParams(window.location.search)).get('id');
const filters = Object.assign({}, {
page,
}, this._params));
}, this._params);

if (id !== null) {
filters.id = +id;
}

tasks = await window.cvat.tasks.get(filters);
} catch (exception) {
let { message } = exception;
if (exception instanceof window.cvat.exceptions.ServerError) {
Expand Down Expand Up @@ -316,6 +323,8 @@ class DashboardView {
this._params.search = search;
}

window.history.replaceState(null, null,
`${window.location.origin}${window.location.pathname}`);
dashboardPagination.twbsPagination('show', 1);
});

Expand Down
4 changes: 3 additions & 1 deletion cvat/apps/engine/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,9 @@ class TaskAnnotation:
def __init__(self, pk, user):
self.user = user
self.db_task = models.Task.objects.prefetch_related("image_set").get(id=pk)
self.db_jobs = models.Job.objects.select_related("segment").filter(segment__task_id=pk)

# Postgres doesn't guarantee an order by default without explicit order_by
self.db_jobs = models.Job.objects.select_related("segment").filter(segment__task_id=pk).order_by('id')
self.ir_data = AnnotationIR()

def reset(self):
Expand Down
18 changes: 18 additions & 0 deletions cvat/apps/engine/migrations/0021_auto_20190826_1827.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.4 on 2019-08-26 15:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('engine', '0020_remove_task_flipped'),
]

operations = [
migrations.AlterField(
model_name='task',
name='frame_filter',
field=models.CharField(blank=True, default='', max_length=256),
),
]
2 changes: 1 addition & 1 deletion cvat/apps/engine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Task(models.Model):
image_quality = models.PositiveSmallIntegerField(default=50)
start_frame = models.PositiveIntegerField(default=0)
stop_frame = models.PositiveIntegerField(default=0)
frame_filter = models.CharField(max_length=256, default="")
frame_filter = models.CharField(max_length=256, default="", blank=True)
status = models.CharField(max_length=32, choices=StatusChoice.choices(),
default=StatusChoice.ANNOTATION)

Expand Down
6 changes: 3 additions & 3 deletions cvat/apps/engine/static/engine/js/cvat-core.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions cvat/apps/engine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def execute_python_code(source_code, global_vars=None, local_vars=None):
details = err.args[0]
line_number = err.lineno
raise InterpreterError("{} at line {}: {}".format(error_class, line_number, details))
except AssertionError as err:
# AssertionError doesn't contain any args and line number
error_class = err.__class__.__name__
raise InterpreterError("{}".format(error_class))
except Exception as err:
error_class = err.__class__.__name__
details = err.args[0]
Expand Down

0 comments on commit 0c33055

Please sign in to comment.