diff --git a/base.yml b/base.yml index b706ee179..9708e9c7a 100644 --- a/base.yml +++ b/base.yml @@ -50,7 +50,7 @@ services: POSTGRES_PASSWORD_FILE: /run/secrets/db_password vite: build: frontend - image: comses/comsesnet-vite + image: comses/vite volumes: - /code/node_modules - ./docker/shared:/shared diff --git a/django/core/mixins.py b/django/core/mixins.py index 9bb16fb3c..f93a23c43 100644 --- a/django/core/mixins.py +++ b/django/core/mixins.py @@ -280,7 +280,7 @@ def handle_spam_detection(self, serializer: serializers.Serializer): def _record_spam(self, instance, spam_context: dict): content_type = ContentType.objects.get_for_model(type(instance)) - # SpamContent updates the content instance on save + # SpamModeration updates the content instance on save spam_moderation, created = SpamModeration.objects.get_or_create( content_type=content_type, object_id=instance.pk, diff --git a/django/core/models.py b/django/core/models.py index 0920ea752..97b2e5696 100644 --- a/django/core/models.py +++ b/django/core/models.py @@ -138,8 +138,13 @@ def update_related_object(self): related_object.is_marked_spam = self.status != self.Status.NOT_SPAM related_object.save() + def __str__(self): + return ( + f"SpamModeration: {self.status} - {self.reviewer} - {self.content_object}" + ) + -class ModeratedContent(index.Indexed, models.Model): +class ModeratedContent(models.Model): spam_moderation = models.ForeignKey( SpamModeration, null=True, blank=True, on_delete=models.SET_NULL ) @@ -152,6 +157,15 @@ class ModeratedContent(index.Indexed, models.Model): ), ) + def mark_spam(self, status=SpamModeration.Status.SPAM, **kwargs): + content_type = ContentType.objects.get_for_model(type(self)) + self.spam_moderation, created = SpamModeration.objects.get_or_create( + status=status, + object_id=self.pk, + content_type=content_type, + **kwargs, + ) + class Meta: abstract = True @@ -634,7 +648,7 @@ def public(self): @add_to_comses_permission_whitelist -class Event(ModeratedContent, ClusterableModel): +class Event(index.Indexed, ModeratedContent, ClusterableModel): title = models.CharField(max_length=300) date_created = models.DateTimeField(default=timezone.now) last_modified = models.DateTimeField(auto_now=True) @@ -767,7 +781,7 @@ def latest_for_feed(self, number=10): @add_to_comses_permission_whitelist -class Job(ModeratedContent, ClusterableModel): +class Job(index.Indexed, ModeratedContent, ClusterableModel): title = models.CharField(max_length=300, help_text=_("Job posting title")) date_created = models.DateTimeField(default=timezone.now) application_deadline = models.DateField( diff --git a/django/home/jinja2/home/index.jinja b/django/home/jinja2/home/index.jinja index 1b8e43f0a..d85d7b287 100644 --- a/django/home/jinja2/home/index.jinja +++ b/django/home/jinja2/home/index.jinja @@ -65,10 +65,9 @@

Publish your Code

- Preserve the digital - artifacts used to derive a publishable finding in an open digital repository that supports - discovery and good practices for software citation, - reproducibility, and reuse. + Preserve the digital artifacts and context used to derive a published research finding in an open digital repository that supports FAIR practices for Research Software, software citation, reproducibility, and reuse. +

+ Promote good practices for developing, documenting, and publishing computational models.
@@ -78,23 +77,24 @@
- Upcoming Events -

Upcoming Events

+ Community Events and Jobs +

Community Events and Jobs

- Upcoming conferences, workshops, and events of interest for the computational modeling community. - CoMSES also organizes and hosts an annual Virtual - Conference every October with a mix of community submitted and invited video presentations. + Upcoming conferences, workshops, training opportunities, schools, and events of broad interest for + the computational modeling community as well as an open jobs board + for computational modelers in academia and industry.
diff --git a/django/library/models.py b/django/library/models.py index f81f4ad96..72bdcc8ab 100644 --- a/django/library/models.py +++ b/django/library/models.py @@ -499,7 +499,7 @@ def get_all_release_programming_languages(self, codebase): @add_to_comses_permission_whitelist -class Codebase(ModeratedContent, ClusterableModel): +class Codebase(index.Indexed, ModeratedContent, ClusterableModel): """ Metadata applicable across a set of CodebaseReleases """ diff --git a/staging.yml b/staging.yml index 8e2292ecd..3c43a7055 100644 --- a/staging.yml +++ b/staging.yml @@ -34,7 +34,7 @@ services: - esdata2:/usr/share/elasticsearch/data vite: build: frontend - image: comses/comsesnet-vite:${RELEASE_VERSION} + image: comses/vite:${RELEASE_VERSION} command: ["npm", "run", "build"] environment: NODE_ENV: "production"