Commit 5df33830 authored by felix.herrmann's avatar felix.herrmann
Browse files

Merge branch '181-e-mail-notification-dashboard' into 'master'

Resolve "E-Mail notification & dashboard"

Closes #181

See merge request !395
parents 5b6ddd66 67387937
...@@ -13,6 +13,7 @@ from discuss_data.dddatasets.models import ( ...@@ -13,6 +13,7 @@ from discuss_data.dddatasets.models import (
LanguageTags, LanguageTags,
License, License,
DataSetAccessRequest, DataSetAccessRequest,
DataSetPublicationRequest,
) )
...@@ -38,3 +39,4 @@ admin.site.register(CollectionMethodsTags) ...@@ -38,3 +39,4 @@ admin.site.register(CollectionMethodsTags)
admin.site.register(AnalysisMethodsTags) admin.site.register(AnalysisMethodsTags)
admin.site.register(DisciplinesTags) admin.site.register(DisciplinesTags)
admin.site.register(DataSetAccessRequest) admin.site.register(DataSetAccessRequest)
admin.site.register(DataSetPublicationRequest)
...@@ -1339,8 +1339,11 @@ class DataSet(models.Model): ...@@ -1339,8 +1339,11 @@ class DataSet(models.Model):
logger.error("in request publication") logger.error("in request publication")
pub_request = DataSetPublicationRequest.objects.filter(dataset=self, user=user) pub_request = DataSetPublicationRequest.objects.filter(dataset=self, user=user)
# TODO: add a check for compatibility between access model and chosen license # TODO: add a check for compatibility between access model and chosen license
logger.error("not self published if")
if not self.published: if not self.published:
logger.error("pub_request.count() < 1 if")
if pub_request.count() < 1: if pub_request.count() < 1:
logger.error("user_has_admin_right if")
if self.user_has_admin_right(user): if self.user_has_admin_right(user):
self.dataset_management_object.save() self.dataset_management_object.save()
self.published_main_category = self.get_main_category() self.published_main_category = self.get_main_category()
...@@ -1363,8 +1366,10 @@ class DataSet(models.Model): ...@@ -1363,8 +1366,10 @@ class DataSet(models.Model):
return _("Dataset publication requested") return _("Dataset publication requested")
else: else:
logger.error("user has no admin right")
return _("Operation not allowed") return _("Operation not allowed")
else: else:
logger.error("pub_request.count() < 1 false")
return _("Dataset publication request pending") return _("Dataset publication request pending")
else: else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment