diff options
author | 2019-10-25 19:19:03 +0200 | |
---|---|---|
committer | 2019-10-25 19:19:03 +0200 | |
commit | 56ec003f965f4340f5bdcede1a511df59370d4b6 (patch) | |
tree | 0c6062daeb7ba124bed6a99796e6382a2ba91738 | |
parent | Change OffensiveMessage.delete_date from datetime.date to datetime.datetime (diff) | |
parent | Merge pull request #294 from bsoyka/patch-1 (diff) |
Merge branch 'master' into #222-offensive-msg-autodeletion
-rw-r--r-- | pydis_site/apps/api/migrations/0046_reminder_jump_url.py | 19 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/reminder.py | 6 | ||||
-rw-r--r-- | pydis_site/apps/api/serializers.py | 2 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_models.py | 4 | ||||
-rw-r--r-- | pydis_site/settings.py | 2 | ||||
-rw-r--r-- | pydis_site/templates/home/index.html | 2 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/breadcrumbs.html | 4 |
7 files changed, 34 insertions, 5 deletions
diff --git a/pydis_site/apps/api/migrations/0046_reminder_jump_url.py b/pydis_site/apps/api/migrations/0046_reminder_jump_url.py new file mode 100644 index 00000000..b145f0dd --- /dev/null +++ b/pydis_site/apps/api/migrations/0046_reminder_jump_url.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.6 on 2019-10-21 14:46 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0045_add_plural_name_for_log_entry'), + ] + + operations = [ + migrations.AddField( + model_name='reminder', + name='jump_url', + field=models.URLField(default='', help_text='The jump url to the message that created the reminder', max_length=88), + preserve_default=False, + ), + ] diff --git a/pydis_site/apps/api/models/bot/reminder.py b/pydis_site/apps/api/models/bot/reminder.py index decc9391..d53fedb5 100644 --- a/pydis_site/apps/api/models/bot/reminder.py +++ b/pydis_site/apps/api/models/bot/reminder.py @@ -15,6 +15,12 @@ class Reminder(ModelReprMixin, models.Model): "If not, it has been sent out to the user." ) ) + jump_url = models.URLField( + max_length=88, + help_text=( + "The jump url to the message that created the reminder" + ) + ) author = models.ForeignKey( User, on_delete=models.CASCADE, diff --git a/pydis_site/apps/api/serializers.py b/pydis_site/apps/api/serializers.py index 4ef7ec78..bc94349e 100644 --- a/pydis_site/apps/api/serializers.py +++ b/pydis_site/apps/api/serializers.py @@ -191,7 +191,7 @@ class ReminderSerializer(ModelSerializer): """Metadata defined for the Django REST Framework.""" model = Reminder - fields = ('active', 'author', 'channel_id', 'content', 'expiration', 'id') + fields = ('active', 'author', 'jump_url', 'channel_id', 'content', 'expiration', 'id') class RoleSerializer(ModelSerializer): diff --git a/pydis_site/apps/api/tests/test_models.py b/pydis_site/apps/api/tests/test_models.py index bce76942..b4a766d0 100644 --- a/pydis_site/apps/api/tests/test_models.py +++ b/pydis_site/apps/api/tests/test_models.py @@ -115,6 +115,10 @@ class StringDunderMethodTests(SimpleTestCase): discriminator=5, avatar_hash=None ), channel_id=555, + jump_url=( + 'https://discordapp.com/channels/' + '267624335836053506/291284109232308226/463087129459949587' + ), content="oh no", expiration=dt(5018, 11, 20, 15, 52, tzinfo=timezone.utc) ) diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 56ac0a1d..94718ec7 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -48,7 +48,7 @@ if DEBUG: 'staff.web' ] ) - SECRET_KEY = secrets.token_urlsafe(32) + SECRET_KEY = "yellow polkadot bikini" # noqa: S105 elif 'CI' in os.environ: ALLOWED_HOSTS = ['*'] diff --git a/pydis_site/templates/home/index.html b/pydis_site/templates/home/index.html index 0fa2f67c..dfcc6715 100644 --- a/pydis_site/templates/home/index.html +++ b/pydis_site/templates/home/index.html @@ -16,7 +16,7 @@ <h1 class="is-size-1">Who are we?</h1> <br> <div class="columns is-desktop"> - <div class="column is-half-desktop"> + <div class="column is-half-desktop content"> <p> We're a large community focused around the Python programming language. We believe anyone can learn to code, and are very dedicated to helping diff --git a/pydis_site/templates/wiki/includes/breadcrumbs.html b/pydis_site/templates/wiki/includes/breadcrumbs.html index 791beb90..1b268e11 100644 --- a/pydis_site/templates/wiki/includes/breadcrumbs.html +++ b/pydis_site/templates/wiki/includes/breadcrumbs.html @@ -10,13 +10,13 @@ {# Continue, we don't want to show the root element #} {% else %} <li> - <a href="{% url 'wiki:get' path=ancestor.path %}">{{ ancestor.article.current_revision.title|truncatechars:25 }}</a> + <a href="{% url 'wiki:get' path=ancestor.path %}">{{ ancestor.article.current_revision.title }}</a> </li> {% endif %} {% endfor %} <li class="is-active"> - <a href="{% url 'wiki:get' path=article.path %}">{{ article.current_revision.title|truncatechars:25 }}</a> + <a href="{% url 'wiki:get' path=article.path %}">{{ article.current_revision.title }}</a> </li> </ul> </nav> |