Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions apps/challenges/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,46 @@ def is_active(self):
return False

def save(self, *args, **kwargs):
from django.core.exceptions import ValidationError

# Validate challenge dates
if self.challenge.start_date and self.challenge.end_date:
if self.challenge.start_date >= self.challenge.end_date:
raise ValidationError(
"Challenge start date must be before challenge end date"
)

# Validate challenge phase dates against challenge dates
if self.start_date and self.end_date and self.challenge:
# Phase start datetime < Phase end datetime
if self.start_date >= self.end_date:
raise ValidationError(
"Challenge phase start date must be before challenge phase end date"
)

# Phase start datetime >= Challenge start datetime
if self.challenge.start_date and self.start_date < self.challenge.start_date:
raise ValidationError(
"Challenge phase start date cannot be before challenge start date"
)

# Phase start datetime < Challenge end datetime
if self.challenge.end_date and self.start_date >= self.challenge.end_date:
raise ValidationError(
"Challenge phase start date must be before challenge end date"
)

# Phase end datetime > Challenge start datetime
if self.challenge.start_date and self.end_date <= self.challenge.start_date:
raise ValidationError(
"Challenge phase end date must be after challenge start date"
)

# Phase end datetime <= Challenge end datetime
if self.challenge.end_date and self.end_date > self.challenge.end_date:
raise ValidationError(
"Challenge phase end date cannot be after challenge end date"
)

# If the max_submissions_per_day is less than the
# max_concurrent_submissions_allowed.
Expand Down
165 changes: 3 additions & 162 deletions docs/source/faq(developers).md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#### Q. How to start contributing?

EvalAIs issue tracker is good place to start. If you find something that interests you, comment on the thread and well help get you started.
EvalAI's issue tracker is good place to start. If you find something that interests you, comment on the thread and we'll help get you started.
Alternatively, if you come across a new bug on the site, please file a new issue and comment if you would like to be assigned. Existing issues are tagged with one or more labels, based on the part of the website it touches, its importance etc., which can help you select one.

#### Q. What are the technologies that EvalAI uses?
Expand All @@ -21,136 +21,12 @@ Refer to [Markdown Guide](https://guides.github.com/features/mastering-markdown/

Coverage decreases when the existing test cases don't test the new code you wrote. If you click coverage, you can see exactly which all parts aren't covered and you can write new tests to test the parts.

#### Q. How to setup EvalAI using virtualenv?
#### Q. How to setup EvalAI?

We have removed the documentation for setting up using virtual environment since the project has grown and different developers face different dependency issues. We recommend to setup EvalAI using docker based environment.
We recommend setting up EvalAI using Docker-based environment for reliability and consistency across systems. Please refer to our [installation guide](https://evalai.readthedocs.io/en/latest/contribute.html).

### Common Errors during installation

#### Q. While using `pip install -r dev/requirement.txt`

```
Writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
Error: You need to install postgresql-server-dev-X.Y for building a server-side extension or
libpq-dev for building a client-side application.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-qIjU8G/psycopg2/
```

Use the following commands in order to solve the error:

1. `sudo apt-get install postgresql`
2. `sudo apt-get install python-psycopg2`
3. `sudo apt-get install libpq-dev`

#### Q. While using `pip install -r dev/requirement.txt`

```
Command “python setup.py egg_info” failed with error code 1 in
/private/var/folders/c7/b45s17816zn_b1dh3g7yzxrm0000gn/T/pip-build- GM2AG/psycopg2/
```

Firstly check that you have installed all the mentioned dependencies.
Then, Upgrade the version of postgresql to 10.1 in order to solve it.

#### Q. Getting an import error

```
Couldn't import Django,"when using command python manage.py migrate
```

Firstly, check that you have activated the virtualenv.
Install python dependencies using the following commands on the command line

```
cd evalai
pip install -r requirements/dev.txt
```

#### Q. Getting Mocha Error

```
Can not load reporter “mocha”,it is not registered
```

Uninstall karma and then install

```
npm uninstall -g generator-karma && npm install -g generator-angular.
```

#### Q. While trying to execute `bower install`

```
bower: command not found
```

Execute the following command first :

```
npm install -g bower
```

#### Q. While trying to execute `gulp dev:runserver`

```
gulp: command not found
```

Execute the following command first

```
npm install -g gulp-cli
```

#### Q. While executing `gulp dev:runserver`

```
events.js:160
throw er; // Unhandled 'error' event
^
Error: Gem sass is not installed.
```

Execute the following command first :

```
gem install sass
```

#### Q. While trying to install `npm config set proxy http://proxy:port` on Ubuntu, I get the following error:

```
ubuntu@ubuntu-Inspiron-3521:~/Desktop/Python-2.7.14$ npm install -g angular-cli
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "angular-cli"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ECONNRESET

npm ERR! network tunneling socket could not be established, cause=getaddrinfo ENOTFOUND proxy proxy:80
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/Desktop/Python-2.7.14/npm-debug.log
```

To solve, execute the following commands:

1. `npm config set registry=registry.npmjs.org`

If the above does not work, try deleting them by following commands:

1. `npm config delete proxy`
2. `npm config delete https-proxy`

Then, start the installation process of frontend once more.

#### Q. While using docker, I am getting the following error on URL [http://localhost:8888/](http://localhost:8888/):

```
Expand All @@ -159,14 +35,6 @@ Cannot Get \

Try removing the docker containers and then building them again.

#### Q. Getting the following error while running `python manage.py seed`:

```
Starting the database seeder. Hang on... Exception while running run() in 'scripts.seed' Database successfully seeded
```

Change the python version to 2.7.x . The problem might be because of the python 3.0 version.

#### Q. Getting the following error while executing command `createdb evalai -U postgres`:

```
Expand All @@ -175,15 +43,6 @@ createdb: could not connect to database template1: FATAL: Peer authentication fa

Try creating a new user and then grant all the privileges to it and then create a db.

#### Q. Getting the following error while executing `npm install`:

```
npm WARN generator-angular@0.16.0 requires a peer of generator-
karma@>=0.9.0 but none was installed.
```

Uninstall and then install karma again and also don't forget to clean the global as well as project npm cache. Then try again the step 8.

#### Q. While running the unit tests, I am getting the error similar to as shown below:

```
Expand Down Expand Up @@ -241,24 +100,6 @@ Exception while running run() in 'scripts.seed'

Try clearing the postgres database manually and try again.

#### Q. Getting the following error while executing `gulp dev:runserver`:

```
/usr/lib//nodejs/gulp//bin/gulp.js:132
gulpInst.start.apply(gulpInst, toRun)l
^
TypeError: Cannot read properly 'apply of undefined'
```

Execute the following command:

```
rm -rf node_modules/
rm -rf bower_components
npm install
bower install
```

#### Q. While trying to build EvalAI from the master branch and run the command docker-compose up:

```
Expand Down
Loading