Skip to content

Commit

Permalink
Merge pull request #30 from morganog/add-contribution
Browse files Browse the repository at this point in the history
ticket #16 Partial add to: reminders
  • Loading branch information
DjangoCRM authored Sep 4, 2024
2 parents 684527e + eef04d0 commit f3e5c5b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions settings/admin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from django.contrib import admin
from django.http.request import HttpRequest

from crm.site.crmadminsite import crm_site
from settings.models import BannedCompanyName
from settings.models import PublicEmailDomain
from settings.models import StopPhrase

from models import Reminders


class BannedCompanyNameAdmin(admin.ModelAdmin):
list_display = ('name',)
Expand All @@ -28,3 +31,12 @@ class StopPhraseAdmin(admin.ModelAdmin):
admin.site.register(BannedCompanyName, BannedCompanyNameAdmin)
admin.site.register(PublicEmailDomain, PublicEmailDomainAdmin)
admin.site.register(StopPhrase, StopPhraseAdmin)

class RemindersAdmin(admin.ModelAdmin):
def has_add_permission(self, request: HttpRequest) -> bool:
return False

def has_delete_permission(self, request: HttpRequest, obj: Any | None = ...) -> bool:
return False

admin.site.register(Reminders, RemindersAdmin)
6 changes: 6 additions & 0 deletions settings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@ def hit(self):

def __str__(self):
return self.phrase

class Reminders(models.Model):
setting_value = models.PositiveBigIntegerField()

def __str__(self):
return f"Reminder {self.setting_value}"

0 comments on commit f3e5c5b

Please sign in to comment.