Commits (3)
......@@ -13,6 +13,7 @@ from discuss_data.dddatasets.models import (
LanguageTags,
License,
DataSetAccessRequest,
DataSetPublicationRequest,
)
......@@ -38,3 +39,4 @@ admin.site.register(CollectionMethodsTags)
admin.site.register(AnalysisMethodsTags)
admin.site.register(DisciplinesTags)
admin.site.register(DataSetAccessRequest)
admin.site.register(DataSetPublicationRequest)
......@@ -1339,8 +1339,11 @@ class DataSet(models.Model):
logger.error("in request publication")
pub_request = DataSetPublicationRequest.objects.filter(dataset=self, user=user)
# TODO: add a check for compatibility between access model and chosen license
logger.error("not self published if")
if not self.published:
logger.error("pub_request.count() < 1 if")
if pub_request.count() < 1:
logger.error("user_has_admin_right if")
if self.user_has_admin_right(user):
self.dataset_management_object.save()
self.published_main_category = self.get_main_category()
......@@ -1363,8 +1366,10 @@ class DataSet(models.Model):
return _("Dataset publication requested")
else:
logger.error("user has no admin right")
return _("Operation not allowed")
else:
logger.error("pub_request.count() < 1 false")
return _("Dataset publication request pending")
else:
......