1. Federico Maggi
  2. django-academic

Commits

Federico Maggi  committed 29d825a Draft

Modified the way an internal person is checked

  • Participants
  • Parent commits 3b2ed52
  • Branches seclab

Comments (0)

Files changed (1)

File academic/publishing/models.py

View file
         verbose_name = _('Publication')
         verbose_name_plural = _('Publications')
         ordering = [
-		'-year',
-		'-month']
+            '-year',
+            '-month']
 
     internal = models.BooleanField(
         _('Internal?'),
         null=True)
     attachment = FileBrowseField(
         _('Attachment'),
-	directory=PUBLISHING_DEFAULT_DIRECTORY,
+        directory=PUBLISHING_DEFAULT_DIRECTORY,
         max_length=256,
         format='File',
         blank=True,
         null=True)
     fulltext = FileBrowseField(
         _('Fulltext'),
-	directory=PUBLISHING_DEFAULT_DIRECTORY,
+        directory=PUBLISHING_DEFAULT_DIRECTORY,
         max_length=256,
         format='Document',
         blank=True,
                     self.first_author or '',
                     self.title,
                     self.year))
-	if not self.internal:
+        if not self.internal:
             for author in self.authors.all():
                 try:
+                    Person.internal_all.get(pk=author.pk)
                     self.internal = True
+                except Person.DoesNotExist:
+                    pass
             super(Publication, self).save(**kwargs)
 
 
         ConferenceEdition)
 
     def __unicode__(self):
-	if not self.conference_edition.acronymized.lower().startswith('proceedings of'):
+        if not self.conference_edition.acronymized.lower().startswith('proceedings of'):
             return u'%s' % self.conference_edition.acronymized
         return u'%s' % self.conference_edition.acronymized
 
         verbose_name = _('Conference paper')
     presentation = FileBrowseField(
         _('Presentation'),
-	directory=PUBLISHING_DEFAULT_DIRECTORY,
+        directory=PUBLISHING_DEFAULT_DIRECTORY,
         max_length=256,
         format='Document',
         blank=True,