Ejemplo n.º 1
0
 def save(self, *args, **kwargs):
     saved_fields = self.get_dirty_fields() or []
     validate_subject_provider_mapping(self.provider, self.bepress_subject)
     validate_subject_highlighted_count(self.provider, bool('highlighted' in saved_fields and self.highlighted))
     if 'text' in saved_fields and self.pk and (self.preprints.exists() or self.abstractnodes.exists()):
         raise ValidationError('Cannot edit a used Subject')
     return super(Subject, self).save()
Ejemplo n.º 2
0
 def save(self, *args, **kwargs):
     saved_fields = self.get_dirty_fields() or []
     validate_subject_provider_mapping(self.provider, self.bepress_subject)
     validate_subject_highlighted_count(self.provider, bool('highlighted' in saved_fields and self.highlighted))
     if 'text' in saved_fields and self.pk and (self.preprintservices.exists() or self.abstractnodes.exists()):
         raise ValidationError('Cannot edit a used Subject')
     return super(Subject, self).save()
Ejemplo n.º 3
0
 def save(self, *args, **kwargs):
     saved_fields = self.get_dirty_fields() or []
     validate_subject_provider_mapping(self.provider, self.bepress_subject)
     if 'text' in saved_fields and self.pk and self.preprint_services.exists():
         raise ValidationError('Cannot edit a used Subject')
     return super(Subject, self).save()