diff --git a/news/migrations/0003_auto_20200507_1737.py b/news/migrations/0003_auto_20200507_1737.py new file mode 100644 index 000000000..12f807de0 --- /dev/null +++ b/news/migrations/0003_auto_20200507_1737.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.12 on 2020-05-07 17:37 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('news', '0002_auto_20190713_1335'), + ] + + operations = [ + migrations.AlterField( + model_name='post', + name='publish', + field=models.DateTimeField(default=django.utils.timezone.now, null=True), + ), + ] diff --git a/news/migrations/0004_auto_20200507_1741.py b/news/migrations/0004_auto_20200507_1741.py new file mode 100644 index 000000000..995ab695f --- /dev/null +++ b/news/migrations/0004_auto_20200507_1741.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.12 on 2020-05-07 17:41 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('news', '0003_auto_20200507_1737'), + ] + + operations = [ + migrations.AlterField( + model_name='post', + name='publish', + field=models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True), + ), + ] diff --git a/news/models.py b/news/models.py index 7c5a27fd7..91b075f1f 100644 --- a/news/models.py +++ b/news/models.py @@ -19,7 +19,7 @@ class Post(models.Model): slug = models.SlugField(max_length=250, unique_for_date='publish') author = models.ForeignKey(User, related_name='blog_posts', on_delete=models.SET_NULL, null=True, blank=True) body = models.TextField() - publish = models.DateTimeField(default=timezone.now, blank=True) + publish = models.DateTimeField(default=timezone.now, null=True, blank=True) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) status = models.CharField(max_length=12, choices=STATUS_CHOICES, default='draft') diff --git a/olly/base_settings.py b/olly/base_settings.py index 47e0fdaa2..33cf456f6 100644 --- a/olly/base_settings.py +++ b/olly/base_settings.py @@ -156,4 +156,4 @@ LOGIN_REDIRECT_URL = '/' LOGIN_URL = '/login/' -SITE_VERSION = "0.8.0" +SITE_VERSION = "0.8.1" diff --git a/olly/context_processors.py b/olly/context_processors.py index 1f2784580..17627f4e8 100644 --- a/olly/context_processors.py +++ b/olly/context_processors.py @@ -1,10 +1,17 @@ from django.conf import settings +from django.core.exceptions import ObjectDoesNotExist + from pages import models as pagesmodels +try: + SocialInfo = pagesmodels.SocialInfo.objects.get(pk=1) +except ObjectDoesNotExist: + SocialInfo = None + def site_info(request): return {'SITE_NAME': settings.SITE_NAME, 'SITE_SERVER': settings.SITE_SERVER, 'SITE_VERSION': settings.SITE_VERSION, - 'SocialInfo': pagesmodels.SocialInfo.objects.get(pk=1), + 'SocialInfo': SocialInfo, 'ESPORTS_MODE': settings.ESPORTS_MODE} diff --git a/olly/settings.py b/olly/settings.py index e5d76d14f..465d47ed7 100644 --- a/olly/settings.py +++ b/olly/settings.py @@ -59,11 +59,13 @@ # Media files MEDIA_ROOT = os.path.join(BASE_DIR, 'olly/media') +AWS_DEFAULT_ACL = 'public-read' AWS_ACCESS_KEY_ID = os.environ['storage_key_id'] AWS_SECRET_ACCESS_KEY = os.environ['storage_secret_key'] AWS_S3_ENDPOINT_URL = os.environ['storage_endpoint_url'] AWS_STORAGE_BUCKET_NAME = os.environ['storage_bucket_name'] AWS_LOCATION = '' +AWS_QUERYSTRING_AUTH = False DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' MEDIA_URL = "%s/%s/" % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME) diff --git a/profiles/forms.py b/profiles/forms.py index 7ac9c1f5f..3cb4e1d1f 100644 --- a/profiles/forms.py +++ b/profiles/forms.py @@ -35,6 +35,7 @@ class Meta: 'epic', 'lol', 'battlenet', + 'activisionid', 'twitter_profile', 'twitch_channel', 'favorite_game', @@ -57,6 +58,8 @@ def __init__(self, *args, **kwargs): ''}) self.fields['battlenet'].widget.attrs.update({'name': 'battlenet', 'class': 'form-control', 'style': ''}) + self.fields['activisionid'].widget.attrs.update({'name': 'activisionid', 'class': 'form-control', 'style': + ''}) self.fields['twitter_profile'].widget.attrs.update({'name': 'twitter_profile', 'class': 'form-control', 'style': ''}) self.fields['twitch_channel'].widget.attrs.update({'name': 'twitch_channel', 'class': 'form-control', 'style': diff --git a/profiles/migrations/0010_delete_usergear.py b/profiles/migrations/0010_delete_usergear.py new file mode 100644 index 000000000..134da3b3c --- /dev/null +++ b/profiles/migrations/0010_delete_usergear.py @@ -0,0 +1,16 @@ +# Generated by Django 2.2.12 on 2020-05-07 18:18 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('profiles', '0009_auto_20190620_1725'), + ] + + operations = [ + migrations.DeleteModel( + name='UserGear', + ), + ] diff --git a/profiles/migrations/0011_userprofile_activisionid.py b/profiles/migrations/0011_userprofile_activisionid.py new file mode 100644 index 000000000..07ccc86f9 --- /dev/null +++ b/profiles/migrations/0011_userprofile_activisionid.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.12 on 2020-05-07 18:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('profiles', '0010_delete_usergear'), + ] + + operations = [ + migrations.AddField( + model_name='userprofile', + name='activisionid', + field=models.CharField(blank=True, default='No Activision ID Linked', max_length=30), + ), + ] diff --git a/profiles/models.py b/profiles/models.py index 3189e4824..c4bccc51a 100644 --- a/profiles/models.py +++ b/profiles/models.py @@ -4,21 +4,6 @@ from django_countries.fields import CountryField -# Create your models here. - - -class UserGear(models.Model): - user = models.ForeignKey(User, related_name='userspecs', on_delete=models.CASCADE) - # see if the guy actually owns a pc - ownpc = models.BooleanField(default=False) - - cpu = models.CharField(max_length=30, default='No CPU specified') - gpu = models.CharField(max_length=30, default='No GPU specified') - psu = models.CharField(max_length=30, default='No PSU specified') - case = models.CharField(max_length=30, default='No Case specified') - os = models.CharField(max_length=30, default='No OS specified') - - class UserProfile(models.Model): def __str__(self): return str(self.user) @@ -40,6 +25,7 @@ def __str__(self): epic = models.CharField(max_length=30, default='No Epic Linked', blank=True) lol = models.CharField(max_length=30, default='No LOL Linked', blank=True) battlenet = models.CharField(max_length=30, default='No Battle.net Linked', blank=True) + activisionid = models.CharField(max_length=30, default='No Activision ID Linked', blank=True) twitter_profile = models.CharField(max_length=30, default='No Twitter Linked', blank=True) twitch_channel = models.CharField(max_length=50, default='No Twitch Linked', blank=True) favorite_game = models.CharField(max_length=50, default='N/A', blank=True) diff --git a/project-templates/base.html b/project-templates/base.html index 2c44a0c48..32e5a8613 100644 --- a/project-templates/base.html +++ b/project-templates/base.html @@ -11,8 +11,7 @@ integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"> - - + {% block head %} PageName - {{ SITE_NAME }} {% endblock %} diff --git a/project-templates/profiles/edit_profile.html b/project-templates/profiles/edit_profile.html index fc56911e2..e5aa00098 100644 --- a/project-templates/profiles/edit_profile.html +++ b/project-templates/profiles/edit_profile.html @@ -22,6 +22,9 @@
{{ form.psn }}
+ +
{{ form.activisionid }}
+
{{ form.twitter_profile }}
diff --git a/project-templates/profiles/profile.html b/project-templates/profiles/profile.html index 872ad3ba9..3badc59b9 100644 --- a/project-templates/profiles/profile.html +++ b/project-templates/profiles/profile.html @@ -36,6 +36,10 @@ PSN: {{ userprofile.psn }} + + Activision ID: + {{ userprofile.activisionid }} + Twitter: {{ userprofile.twitter_profile }} diff --git a/project-templates/profiles/registration_form.html b/project-templates/profiles/registration_form.html index a0e49fbd0..73c14d855 100644 --- a/project-templates/profiles/registration_form.html +++ b/project-templates/profiles/registration_form.html @@ -8,8 +8,8 @@

Add a new account

{% csrf_token %} - {% include 'profiles/stock/registration_form_template.html' %} - {% include 'profiles/stock/captcha.html' %} + {% include 'profiles/registration_form_template.html' %} + {% include 'profiles/captcha.html' %}
{% endblock %} diff --git a/project-templates/staff/news/news_article_edit.html b/project-templates/staff/news/news_article_edit.html index 623e1aa55..bed21ac23 100644 --- a/project-templates/staff/news/news_article_edit.html +++ b/project-templates/staff/news/news_article_edit.html @@ -56,6 +56,7 @@