Resolve "Add optional donation/contribution link in-app"

This commit is contained in:
Eliot Berriot 2019-09-23 11:30:25 +02:00
parent 5936dfc2bf
commit 01223afa80
17 changed files with 312 additions and 8 deletions

View file

@ -82,6 +82,18 @@ PERMISSIONS = sorted(PERMISSIONS_CONFIGURATION.keys())
get_file_path = common_utils.ChunkedPath("users/avatars", preserve_file_name=False)
def get_default_instance_support_message_display_date():
return timezone.now() + datetime.timedelta(
days=settings.INSTANCE_SUPPORT_MESSAGE_DELAY
)
def get_default_funkwhale_support_message_display_date():
return timezone.now() + datetime.timedelta(
days=settings.FUNKWHALE_SUPPORT_MESSAGE_DELAY
)
@python_2_unicode_compatible
class User(AbstractUser):
@ -149,6 +161,15 @@ class User(AbstractUser):
upload_quota = models.PositiveIntegerField(null=True, blank=True)
instance_support_message_display_date = models.DateTimeField(
default=get_default_instance_support_message_display_date, null=True, blank=True
)
funkwhale_support_message_display_date = models.DateTimeField(
default=get_default_funkwhale_support_message_display_date,
null=True,
blank=True,
)
def __str__(self):
return self.username