Commit c9cb9439 authored by fred's avatar fred
Browse files

trivial: apply new pre-commit configuration

parent ea19914d
from django.contrib import admin
from .models import Subscriber
admin.site.register(Subscriber)
from django import forms
from .models import Subscriber, Newsletter
from .models import Newsletter, Subscriber
class SubscribeForm(forms.ModelForm):
......
# -*- coding: utf-8 -*-
from datetime import datetime
import time
import gzip
import xml.etree.ElementTree as ET
import os
import re
import urllib2
from PIL import Image
import time
import xml.etree.ElementTree as ET
from datetime import datetime
from optparse import make_option
import urllib2
from django.conf import settings
from django.core.files import File
from django.core.management.base import BaseCommand, CommandError
from django.urls import reverse
from django.utils.html import strip_tags
from django.utils.text import slugify
from PIL import Image
from ...models import Subscriber
class Author(object):
class Author:
id_auteur = None
email = None
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import ckeditor.fields
from django.db import migrations, models
class Migration(migrations.Migration):
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-01-31 16:30
from __future__ import unicode_literals
from django.db import migrations, models
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-01-31 17:14
from __future__ import unicode_literals
from django.db import migrations, models
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-01-31 17:21
from __future__ import unicode_literals
from django.db import migrations, models
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-01-31 19:13
from __future__ import unicode_literals
from django.db import migrations, models
......
......@@ -3,26 +3,21 @@ import hashlib
import random
import smtplib
import subprocess
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import html2text
from django.db import models, IntegrityError
from django.urls import reverse
from ckeditor.fields import RichTextField
from django.conf import settings
from django.core.mail import send_mail
from django.db import IntegrityError, models
from django.template import loader
from django.template.loader import render_to_string
from django.conf import settings
from django.urls import reverse
from django.utils.encoding import force_bytes
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext
from django.utils.translation import ugettext_lazy as _
from django.core.mail import send_mail
from ckeditor.fields import RichTextField
class Subscriber(models.Model):
......
from django.conf.urls import url
from django.conf import settings
from django.conf.urls import url
from .views import (
subscribe,
thanks,
confirmation,
stats,
newsletter_list,
newsletter_create,
newsletter_view,
newsletter_update,
newsletter_list,
newsletter_send,
newsletter_update,
newsletter_view,
stats,
subscribe,
thanks,
)
urlpatterns = [
......
import datetime
import email
import hashlib
import random
import socket
import datetime
import django.utils.six.moves.http_cookiejar as cookielib
import django.utils.six.moves.urllib as urllib2
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.urls import reverse_lazy
from django.db import models, IntegrityError
from django.http import JsonResponse, HttpResponseRedirect
from django.db import IntegrityError, models
from django.http import HttpResponseRedirect, JsonResponse
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.utils.http import urlencode
from django.utils.translation import ugettext as _
import django.utils.six.moves.urllib as urllib2
import django.utils.six.moves.http_cookiejar as cookielib
from django.views.generic.base import TemplateView, RedirectView
from django.views.decorators.csrf import csrf_exempt
from django.views.generic.base import RedirectView, TemplateView
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView, UpdateView
from django.views.decorators.csrf import csrf_exempt
from django.views.generic.list import ListView
from .forms import SubscribeForm, NewsletterForm
from .models import Subscriber, Newsletter
from .forms import NewsletterForm, SubscribeForm
from .models import Newsletter, Subscriber
class SubscribeView(CreateView):
......@@ -63,7 +62,7 @@ class ConfirmationView(TemplateView):
template_name = 'newsletter/done.html'
def get_context_data(self, token, **kwargs):
context = super(ConfirmationView, self).get_context_data(**kwargs)
context = super().get_context_data(**kwargs)
subscriber = get_object_or_404(Subscriber, password=token, is_validated=False)
subscriber.is_validated = True
subscriber.save()
......@@ -82,10 +81,10 @@ class NewsletterCreateView(CreateView):
def get_form(self, *args, **kwargs):
if not self.request.user.has_perm('newsletter.add_newsletter'):
raise PermissionDenied()
return super(NewsletterCreateView, self).get_form(*args, **kwargs)
return super().get_form(*args, **kwargs)
def get_initial(self):
initial = super(NewsletterCreateView, self).get_initial()
initial = super().get_initial()
initial['date'] = datetime.datetime.today()
return initial
......@@ -114,7 +113,7 @@ class NewsletterUpdateView(UpdateView):
def get_form(self, *args, **kwargs):
if not self.request.user.has_perm('newsletter.add_newsletter'):
raise PermissionDenied()
return super(NewsletterUpdateView, self).get_form(*args, **kwargs)
return super().get_form(*args, **kwargs)
newsletter_update = NewsletterUpdateView.as_view()
......
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess
import sys
from setuptools.command.install_lib import install_lib as _install_lib
from distutils.cmd import Command
from distutils.command.build import build as _build
from distutils.command.sdist import sdist as _sdist
from distutils.cmd import Command
from setuptools import setup, find_packages
from setuptools import find_packages, setup
from setuptools.command.install_lib import install_lib as _install_lib
class sdist(_sdist):
......@@ -26,7 +25,7 @@ class sdist(_sdist):
def get_version():
if os.path.exists('VERSION'):
with open('VERSION', 'r') as v:
with open('VERSION') as v:
return v.read()
if os.path.exists('.git'):
p = subprocess.Popen(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment