SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit e76e3dab authored by Jorran de Wit's avatar Jorran de Wit
Browse files

COI

parent e30f37b1
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,7 @@ INSTALLED_APPS = (
'colleges',
'commentaries',
'comments',
'conflicts',
'finances',
'invitations',
'journals',
......
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class ConflictsConfig(AppConfig):
name = 'conflicts'
STATUS_UNVERIFIED, STATUS_VERIFIED = 'unverified', 'verified'
STATUS_DEPRECATED = 'deprecated'
CONFLIC_OF_INTEREST_STATUSES = (
(STATUS_UNVERIFIED, 'Unverified'),
(STATUS_VERIFIED, 'Verified by Admin'),
(STATUS_DEPRECATED, 'Deprecated'),
)
from django.db import models
from .constants import CONFLIC_OF_INTEREST_STATUSES, STATUS_UNVERIFIED
class ConflictOfInterest(models.Model):
"""Conflict of Interest is a flagged relation between scientists."""
status = models.CharField(
max_length=16, choices=CONFLIC_OF_INTEREST_STATUSES, default=STATUS_UNVERIFIED)
origin = models.ForeignKey('scipost.Contributor')
to_contributor = models.ForeignKey('scipost.Contributor', blank=True, null=True)
to_unregistered = models.ForeignKey('journals.UnregisteredAuthor', blank=True, null=True)
def clean(self):
if not self.to_contributor and not self.to_unregistered:
raise NotImplementedError('Choose something...')
raise NotImplementedError('Fine.')
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment