Coverage for apps/comments_api/constants.py: 100%

29 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2024-02-28 09:09 +0000

1from django.utils.translation import gettext_lazy as _ 

2 

3# -------- Model constants 

4STATUS_DRAFT = "draft" 

5STATUS_SUBMITTED = "submitted" 

6STATUS_VALIDATED = "validated" 

7STATUS_SOFT_DELETED = "deleted" 

8STATUS_REJECTED = "rejected" 

9COMMENT_STATUS_CHOICES = ( 

10 (STATUS_DRAFT, _("Draft")), 

11 (STATUS_SUBMITTED, _("Submitted")), 

12 (STATUS_VALIDATED, _("Validated")), 

13 (STATUS_REJECTED, _("Rejected")), 

14 (STATUS_SOFT_DELETED, _("Deleted")), 

15) 

16 

17MODERATION_STATUS_CHOICES = ( 

18 (STATUS_VALIDATED, _("Validated")), 

19 (STATUS_REJECTED, _("Rejected")), 

20) 

21 

22STATUS_LIST = [t[0] for t in COMMENT_STATUS_CHOICES] 

23# Base status for which the comment's deletion is allowed 

24STATUS_CAN_DELETE = [STATUS_DRAFT, STATUS_SUBMITTED] 

25# Base status for which the comment's edition is allowed 

26STATUS_CAN_EDIT = [STATUS_DRAFT, STATUS_SUBMITTED] 

27# Moderation status 

28STATUS_MODERATED = [STATUS_VALIDATED, STATUS_REJECTED] 

29 

30STATUS_PARENT_VALIDATED = [STATUS_VALIDATED, STATUS_SOFT_DELETED] 

31 

32# -------- Request constants 

33API_MESSAGE_KEY = "error_message" 

34 

35PARAM_DASHBOARD = "dashboard" 

36PARAM_WEBSITE = "website" 

37PARAM_DOI = "doi" 

38PARAM_STATUS = "status" 

39PARAM_COLLECTION = "collection_id" 

40PARAM_USER = "user_id" 

41PARAM_MODERATOR = "moderator_id" 

42PARAM_ADMIN = "admin" 

43PARAM_PREVIEW = "preview_id" 

44PARAM_COMMENT = "comment_id" 

45PARAM_ACTION = "action" 

46 

47PARAM_ACTION_CREATE = "create" 

48PARAM_ACTION_DELETE = "delete" 

49PARAM_BOOLEAN_VALUE = "true" 

50 

51# --------- Content constants 

52API_DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"