]> git.parisson.com Git - teleforma.git/commitdiff
Migration to Django 3 in progress
authorYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 22 Dec 2021 17:00:45 +0000 (18:00 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 22 Dec 2021 17:00:45 +0000 (18:00 +0100)
16 files changed:
app/settings.py
teleforma/migrations/0001_initial.py
teleforma/migrations/0002_auto_20211222_1725.py [new file with mode: 0644]
teleforma/models/ae.py
teleforma/models/core.py
teleforma/models/crfpa.py
teleforma/models/pro.py
teleforma/templates/postman/base.html
teleforma/templates/postman/base_folder.html
teleforma/templates/postman/view.html
teleforma/templates/teleforma/answers.html
teleforma/templates/teleforma/base.html
teleforma/templates/teleforma/inc/user_list.html
teleforma/templates/teleforma/profile_detail.html
teleforma/views/crfpa.py
teleforma/views/pages.py

index 105fb5c741937510c9749bfbb0e3cc8591b2c26d..11128011ff81390cdd1cf2cd70a33a1f6beb1993 100644 (file)
@@ -163,7 +163,7 @@ ROOT_URLCONF = 'urls'
 
 
 INSTALLED_APPS = (
-
+    'jazzmin',
     # 'south',
     'django.contrib.auth',
     'django.contrib.contenttypes',
@@ -183,7 +183,6 @@ INSTALLED_APPS = (
     "mezzanine.galleries",
     # "mezzanine.twitter",
     'teleforma',
-    'jazzmin',
     'django.contrib.admin',
     'jsonrpc',
     'sorl.thumbnail',
@@ -249,10 +248,10 @@ POSTMAN_DISALLOW_ANONYMOUS = True
 
 #FILE_PROTECTION_METHOD = 'xsendfile'
 
-TELEFORMA_ORGANIZATION = 'Pré-Barreau - CRFPA'
-TELEFORMA_SUBJECTS = ('Barreau', 'CRFPA', 'e-learning')
-TELEFORMA_DESCRIPTION = "E-learning Pré-Barreau - CRFPA"
-TELEFORMA_E_LEARNING_TYPE = 'CRFPA'
+TELEFORMA_ORGANIZATION = 'Pro-Barreau'
+TELEFORMA_SUBJECTS = ('Barreau', 'e-learning')
+TELEFORMA_DESCRIPTION = "E-learning Pro-Barreau"
+TELEFORMA_E_LEARNING_TYPE = 'Pro-Barreau'
 TELEFORMA_GLOBAL_TWEETER = False
 TELEFORMA_PERIOD_TWEETER = True
 TELEFORMA_EXAM_TOPIC_DEFAULT_DOC_TYPE_ID = 4
@@ -264,8 +263,10 @@ TELEFORMA_EXAM_SCRIPT_MAX_SIZE = 20480000
 TELEFORMA_EXAM_SCRIPT_SERVICE_URL = '/webviewer/teleforma.html'
 
 EMAIL_HOST = 'angus.parisson.com'
-DEFAULT_FROM_EMAIL = 'crfpa@pre-barreau.com'
-SERVER_EMAIL = 'crfpa@pre-barreau.com'
+DEFAULT_FROM_EMAIL = 'e-learning@pro-barreau.com'
+SERVER_EMAIL = 'webmaster@parisson.com'
+REPORT_TO_EMAIL = ('kostya.rilov@pre-barreau.com', 'alexia.dcruz@pro-barreau.com')
+ADMIN_USERNAME = 'Pro-Barreau'
 EMAIL_SUBJECT_PREFIX = '[' + TELEFORMA_ORGANIZATION + '] '
 
 TELECASTER_LIVE_STREAMING_PROTOCOL = 'https'
@@ -387,12 +388,13 @@ def show_user_as(user):
 
 POSTMAN_SHOW_USER_AS = show_user_as
 
-#THUMBNAIL_FORCE_OVERWRITE = True
+# MEZZANINE
 GRAPPELLI_INSTALLED = False
+COMMENTS_NUM_LATEST = 5
 
 JAZZMIN_SETTINGS = {
-    "site_title": "CRFPA",
-    "site_header": "CRFPA",
+    "site_title": "Probarreau - E-learning",
+    "site_header": "Probarreau",
     "site_logo": "teleforma/images/logo_pb.png",
 
     # # Links to put along the top menu
index a211e34b822b6897a5d23d2e8563fc0b0ec1fa63..4e769996edec57d70ea3e9477fafbe4a39adee2e 100644 (file)
@@ -30,8 +30,6 @@ class Migration(migrations.Migration):
                 ('_meta_title', models.CharField(blank=True, help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title')),
                 ('description', models.TextField(blank=True, verbose_name='Description')),
                 ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')),
-                ('created', models.DateTimeField(editable=False, null=True)),
-                ('updated', models.DateTimeField(editable=False, null=True)),
                 ('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')),
                 ('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')),
                 ('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')),
@@ -241,8 +239,6 @@ class Migration(migrations.Migration):
                 ('_meta_title', models.CharField(blank=True, help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title')),
                 ('description', models.TextField(blank=True, verbose_name='Description')),
                 ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')),
-                ('created', models.DateTimeField(editable=False, null=True)),
-                ('updated', models.DateTimeField(editable=False, null=True)),
                 ('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')),
                 ('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')),
                 ('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')),
diff --git a/teleforma/migrations/0002_auto_20211222_1725.py b/teleforma/migrations/0002_auto_20211222_1725.py
new file mode 100644 (file)
index 0000000..d44e16e
--- /dev/null
@@ -0,0 +1,33 @@
+# Generated by Django 3.2.3 on 2021-12-22 17:25
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('teleforma', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='conference',
+            name='created',
+            field=models.DateTimeField(editable=False, null=True),
+        ),
+        migrations.AddField(
+            model_name='conference',
+            name='updated',
+            field=models.DateTimeField(editable=False, null=True),
+        ),
+        migrations.AddField(
+            model_name='seminar',
+            name='created',
+            field=models.DateTimeField(editable=False, null=True),
+        ),
+        migrations.AddField(
+            model_name='seminar',
+            name='updated',
+            field=models.DateTimeField(editable=False, null=True),
+        ),
+    ]
index eb97b8799f33cb2ecf4b0ca3cf44a7f8c31db7e7..df993a92e51c1552b24b8dc48afa0333866f7449 100644 (file)
@@ -50,7 +50,7 @@ class AEStudent(Model):
                                         verbose_name=_('courses'),
                                         blank=True)
     
-    def __unicode__(self):
+    def __str__(self):
         try:
             return self.user.last_name + ' ' + self.user.first_name
         except:
index 5ef858af6946436a8483626ea08178858b389b03..a84ade4c9f1dd5af3cc9537843fff3f835d42dd3 100755 (executable)
@@ -133,7 +133,7 @@ class Organization(Model):
     name            = CharField(_('name'), max_length=255)
     description     = CharField(_('description'), max_length=255, blank=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.name
 
     class Meta(MetaCore):
@@ -151,7 +151,7 @@ class Department(Model):
     signature       = models.ImageField(_('Signature image'), upload_to='images/%Y/%m/%d',
                                         blank=True, null=True, max_length=1024)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.name
 
     @property
@@ -186,7 +186,7 @@ class Location(Model):
         verbose_name_plural = _('locations')
         ordering = ['name']
 
-    def __unicode__(self):
+    def __str__(self):
         return self.name
 
 
@@ -195,7 +195,7 @@ class LocationType(Model):
     code = models.CharField(_('identifier'), max_length=64, unique=True)
     name = models.CharField(_('name'), max_length=150)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.name
 
     class Meta(MetaCore):
@@ -209,7 +209,7 @@ class Period(Model):
     name            = CharField(_('name'), max_length=255)
     description     = CharField(_('description'), max_length=255, blank=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.name
 
     class Meta(MetaCore):
@@ -221,7 +221,7 @@ class CourseType(Model):
     name            = CharField(_('name'), max_length=255)
     description     = CharField(_('description'), max_length=255, blank=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.name
 
     class Meta(MetaCore):
@@ -249,7 +249,7 @@ class Course(Model):
 
     notes = GenericRelation(Note)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.title
 
     @property
@@ -291,7 +291,7 @@ class CourseDomain(Model):
                                         verbose_name=_('courses'),
                                         blank=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.name
 
     class Meta(MetaCore):
@@ -313,7 +313,7 @@ class Professor(Model):
                                     blank=True)
 
 
-    def __unicode__(self):
+    def __str__(self):
         if self.user.first_name or self.user.last_name:
             return self.user.last_name + ' ' + self.user.first_name
         else:
@@ -339,7 +339,7 @@ class Room(Model):
     name            = CharField(_('name'), max_length=255)
     description     = CharField(_('description'), max_length=255, blank=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.organization.name + ' - ' + self.name
 
     class Meta(MetaCore):
@@ -359,7 +359,7 @@ class StreamingServer(Model):
     source_password = CharField(_('source password'), max_length=32)
     admin_password  = CharField(_('admin password'), max_length=32, blank=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.host + ':' + self.port + ' - ' + self.type
 
     class Meta(MetaCore):
@@ -407,7 +407,7 @@ class LiveStream(Model):
         url = 'https://' + self.server.host + ':' + str(self.server.port) + '/' + self.mount_point
         return url
 
-    def __unicode__(self):
+    def __str__(self):
         if self.conference:
             return self.conference.title
         else:
@@ -445,7 +445,7 @@ class DocumentType(Model):
     description     = CharField(_('description'), max_length=255, blank=True)
     number          = IntegerField(_('number'), blank=True, null=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.name
 
     class Meta(MetaCore):
@@ -487,7 +487,7 @@ class Document(MediaBase):
     def set_mime_type(self):
         self.mime_type = mimetypes.guess_type(self.file.path)[0]
 
-    def __unicode__(self):
+    def __str__(self):
         return self.full_title
 
     @cached_property
@@ -547,7 +547,7 @@ class MediaTranscoded(Model):
         else:
             return self.mimetype
 
-    def __unicode__(self):
+    def __str__(self):
         if self.item.title:
             return self.item.title + ' - ' + self.mime_type
         else:
@@ -588,7 +588,7 @@ class Media(MediaBase):
             else:
                 self.mime_type = mime_type
 
-    def __unicode__(self):
+    def __str__(self):
         return self.full_title
 
     @cached_property
@@ -901,7 +901,7 @@ class Conference(Displayable, WebclassMixin, ProductCodeMixin, SuggestionsMixin)
     def get_absolute_url(self):
         return reverse('conference-view', kwargs={"pk": self.id})
 
-    def __unicode__(self):
+    def __str__(self):
         if self.professor:
             list = [self.title, self.course.title,
                            self.session,
@@ -995,15 +995,14 @@ class NamePaginator(object):
 
         # chunk up the objects so we don't need to iterate over the whole list for each letter
         chunks = {}
-
         for obj in self.object_list:
             if on:
-                obj_str = getattr(obj, on).encode('utf8')
+                obj_str = getattr(obj, on)
             else:
-                obj_str = obj.encode('utf8')
+                obj_str = obj
 
             if len(obj_str):
-                letter = str.upper(obj_str[0])
+                letter = str.upper(str(obj_str[0]))
             else:
                 letter = ''
 
index 994e6212eac3b0ef9d3e28158fe291a4940036a4..30aba090b4d1f7998aca34abbaac3026e71edc53 100644 (file)
@@ -46,7 +46,7 @@ class IEJ(Model):
     name            = CharField(_('name'), max_length=255)
     description     = CharField(_('description'), max_length=255, blank=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.name
 
     class Meta(MetaCore):
@@ -91,7 +91,7 @@ class Training(Model):
                                         blank=True)
     cost            = FloatField(_('cost'), blank=True, null=True)
 
-    def __unicode__(self):
+    def __str__(self):
         code = self.code
         if self.period:
             code += ' - ' + self.period.name
@@ -127,7 +127,7 @@ class Student(Model):
     options         = ForeignKey('Course', related_name="options", verbose_name=_('options'),
                                         blank=True, null=True, on_delete=models.SET_NULL)
 
-    def __unicode__(self):
+    def __str__(self):
         try:
             return self.user.last_name + ' ' + self.user.first_name
         except:
index 27db37ea9046c6dcb1cfbb208c838df81dfac6fc..0f9c618b4296a6a50531ede67d9b1cc061c08f52 100644 (file)
@@ -47,7 +47,7 @@ class SeminarType(models.Model):
 
     name            = models.CharField(_('name'), max_length=255, blank=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.name
 
     class Meta(MetaCore):
@@ -133,7 +133,7 @@ class Seminar(ClonableMixin, Displayable, ProductCodeMixin, SuggestionsMixin):
 
     search_fields = {'description': 1, 'sub_title':2, 'index':1}
 
-    def __unicode__(self):
+    def __str__(self):
         if self.publish_date:
             return ' - '.join([str(self.publish_date.year), self.course.title, str(self.rank), self.title])
         else:
@@ -243,7 +243,7 @@ class Question(ClonableMixin, models.Model):
     min_nchar   = models.IntegerField(_('minimum numbers of characters'))
     status      = models.IntegerField(_('status'), choices=STATUS_CHOICES, default=3)
 
-    def __unicode__(self):
+    def __str__(self):
         return ' - '.join([str(self.seminar), self.title, str(self.rank)])
 
     class Meta(MetaCore):
@@ -264,7 +264,7 @@ class Answer(models.Model):
     date_validated = models.DateTimeField(_('date validated'), null=True)
     date_added     = models.DateTimeField(_('date added'), auto_now_add=True, null=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return ' - '.join([str(self.question), self.user.username, str(self.date_submitted)])
 
     def validate(self):
@@ -294,7 +294,7 @@ class TestimonialTemplate(models.Model):
     document     = models.ForeignKey(Document, related_name="testimonial_template",
                                 verbose_name=_('template'), on_delete=models.CASCADE)
 
-    def __unicode__(self):
+    def __str__(self):
         return ' - '.join([self.organization.name, self.description])
 
     class Meta(MetaCore):
@@ -336,7 +336,7 @@ class Testimonial(models.Model):
             self.title = self.get_title()
         super(Testimonial, self).save(**kwargs)
 
-    def __unicode__(self):
+    def __str__(self):
         if self.title:
             return self.title
         else:
@@ -375,7 +375,7 @@ class Auditor(models.Model):
     expiration_date = models.DateField(_('Expiration_date'), blank=True, null=True)
     init_password   = models.BooleanField(_('Password initialized'))
 
-    def __unicode__(self):
+    def __str__(self):
         try:
             return self.user.last_name + ' ' + self.user.first_name
         except:
@@ -403,7 +403,7 @@ class SeminarRevision(models.Model):
     date        = models.DateTimeField(_('date added'), auto_now_add=True, null=True)
     date_modified  = models.DateTimeField(_('date modified'), blank=True, null=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return ' - '.join([self.seminar.title, self.user.username, str(self.date), str(self.date_modified)])
 
     class Meta(MetaCore):
@@ -427,7 +427,7 @@ class QuizValidation(models.Model):
     validated   = models.BooleanField(_('validated'))
     date_validated = models.DateTimeField(_('date validated'), auto_now_add=True, null=True)
 
-    def __unicode__(self):
+    def __str__(self):
         return ' - '.join([str(self.quiz), self.user.username, str(self.date_validated)])
 
     def validate(self):
index 284cacddbd290ede1f9ed8e46b24d3e7afe0dfa7..44b8a18af97c045d6848f60e0a69d8e93bc49702 100644 (file)
 <div style="background: white;">
 {% postman_unread as unread_count %}
 <ul>
-<li><a href="{% url 'postman_inbox' %}">{% if unread_count %} <strong>{% trans "Inbox" %} ({{ unread_count }})</strong>{% else %}{% trans "Inbox" %}{% endif %}</a></li>
-<li><a href="{% url 'postman_sent' %}">{% trans "Sent Messages" %}</a></li>
-<li><a href="{% url 'postman_archives' %}">{% trans "Archives" %}</a></li>
-<li><a href="{% url 'postman_trash' %}">{% trans "Trash" %}</a></li>
+<li><a href="{% url 'postman:inbox' %}">{% if unread_count %} <strong>{% trans "Inbox" %} ({{ unread_count }})</strong>{% else %}{% trans "Inbox" %}{% endif %}</a></li>
+<li><a href="{% url 'postman:sent' %}">{% trans "Sent Messages" %}</a></li>
+<li><a href="{% url 'postman:archives' %}">{% trans "Archives" %}</a></li>
+<li><a href="{% url 'postman:trash' %}">{% trans "Trash" %}</a></li>
 </ul>
 </div>
 </div>
 
 <div class="module_action">
-<a href="{% url 'postman_write' %}" class="component_icon button" id="action_orange">{% trans "New message" %}</a>
+<a href="{% url 'postman:write' %}" class="component_icon button" id="action_orange">{% trans "New message" %}</a>
 </div>
 
 </div>
index ec5c69211289975d31d4d04fa78bca76ec9cb37b..7426226bd2b34c24bef7e3285e3d30d184135393 100644 (file)
   <tr>
    <td><input type="checkbox" {% if by_conversation and message.thread_id %}name="tpks" value="{{ message.thread_id }}"{% else %}name="pks" value="{{ message.pk }}"{% endif %} /></td>
 
-   {% block pm_sender_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url 'postman_view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">{% if message.is_new %}<strong>{% endif %}{{ message.obfuscated_sender|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}{% if message.is_new %}</strong>{% endif %}</a></td>{% endblock %}
+   {% block pm_sender_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url 'postman:view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">{% if message.is_new %}<strong>{% endif %}{{ message.obfuscated_sender|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}{% if message.is_new %}</strong>{% endif %}</a></td>{% endblock %}
 
-   {% block pm_recipient_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url 'postman_view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">{{ message.obfuscated_recipient|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}</a></td>{% endblock %}
+   {% block pm_recipient_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url 'postman:view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">{{ message.obfuscated_recipient|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}</a></td>{% endblock %}
 
    <td>{% if message.is_new %}<strong>{% endif %}{% if message.is_replied %}<em>{% endif %}
    {% block pm_subject %}
-    <a href="{% if by_conversation and message.thread_id %}{% url 'postman_view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">
+    <a href="{% if by_conversation and message.thread_id %}{% url 'postman:view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">
     {% include "postman/inc_subject_ex.html" %}
     </a>{% endblock %}
    {% if message.is_replied %}</em>{% endif %}{% if message.is_new %}</strong>{% endif %}</td>
 <br />
 {% block pm_form_buttons %}<span id="pm_buttons">
 {% block pm_delete_button %}
-<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_delete' %}'; f.submit(); return false;">{% trans "Delete" %}</a>
+<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman:delete' %}'; f.submit(); return false;">{% trans "Delete" %}</a>
 {% endblock %}
 {% block pm_archive_button %}
-<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_archive' %}'; f.submit(); return false;">{% trans "Archive" %}</a>
+<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman:archive' %}'; f.submit(); return false;">{% trans "Archive" %}</a>
 {% endblock %}
 {% block pm_undelete_button %}
-<a href="#" class="component_icon button icon_previous" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_undelete' %}'; f.submit(); return false;">{% trans "Undelete" %}</a>
+<a href="#" class="component_icon button icon_previous" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman:undelete' %}'; f.submit(); return false;">{% trans "Undelete" %}</a>
 {% endblock %}
 </span>{% endblock %}
 
index e77a4c1f5aa9104fd3043e0974da4dc3ee7cf2a5..418af0e505305c7fd1a351187f6f4cb41b34ac03 100644 (file)
 <a href="{{ next_url }}" class="component_icon button icon_previous">{% trans "Back" %}</a>
 <span id="pm_buttons">
 {% block pm_delete_button %}
-<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_delete' %}'; f.submit(); return false;">{% trans "Delete" %}</a>
+<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman:delete' %}'; f.submit(); return false;">{% trans "Delete" %}</a>
 {% endblock %}
 {% block pm_archive_button %}
 {% if not archived %}
-<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_archive' %}'; f.submit(); return false;">{% trans "Archive" %}</a>
+<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman:archive' %}'; f.submit(); return false;">{% trans "Archive" %}</a>
 {% endif %}
 {% endblock %}
 
-{% if reply_to_pk %}<a class="component_icon button icon_next" href="{% url 'postman_reply' reply_to_pk %}?next={{ next_url|urlencode }}">{% trans "Reply" %}</a>{% endif %}
+{% if reply_to_pk %}<a class="component_icon button icon_next" href="{% url 'postman:reply' reply_to_pk %}?next={{ next_url|urlencode }}">{% trans "Reply" %}</a>{% endif %}
 
 <br /><br />
 
 </form>
 {% if reply_to_pk %}<hr />
 <h2>{% trans 'Reply' %}</h2>
-<form id="_messageReply" action="{% url 'postman_reply' reply_to_pk %}?next={{ next_url|urlencode }}" method="post">{% csrf_token %}
+<form id="_messageReply" action="{% url 'postman:reply' reply_to_pk %}?next={{ next_url|urlencode }}" method="post">{% csrf_token %}
 <div id="pm_reply">{{ form.body }}</div><br />
 <a href="#" class="component_icon button icon_next" onclick="f=document.getElementById('_messageReply'); f.submit(); return false;">{% trans "Reply" %}</a>
 {% endif %}
index b4724b9ec6599b84940954e74c118eba7c1055a4..9851d4424fc72e7505161e201a98e27f0929d2e4 100644 (file)
@@ -35,7 +35,7 @@ var answerUtils = {
 
 {% block modules %}
 <div class="module">
-<h3><a href="{% url teleforma-desk %}"><img src="{{ STATIC_URL }}teleforma/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% trans "Answers" %}</a></h3>
+<h3><a href="{% url 'teleforma-desk' %}"><img src="{{ STATIC_URL }}teleforma/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% trans "Answers" %}</a></h3>
  <div style="background: white;">
   <ul>
   {% block courses %}
index 6c94814d2e8868f0b13a97bf71947bf5b70eee87..6e9e9b029493ca6bb99498cac3d42abe5c6d1fc8 100644 (file)
@@ -89,7 +89,7 @@ alt="logo" />
 
  {% if user.is_authenticated %}
 
-    <li><a href="{% url 'postman_inbox' %}" class="orange">{% trans "Contact us" %}{% if postman_unread_count %} ({{ postman_unread_count }}){% endif %}</a></li>
+    <li><a href="{% url 'postman:inbox' %}" class="orange">{% trans "Contact us" %}{% if postman_unread_count %} ({{ postman_unread_count }}){% endif %}</a></li>
 
  {% if user.is_staff %}
    <li><a href="{% url 'teleforma-users' %}" class="yellow">{% trans "Users" %}</a></li>
index d6b63e0ed484858be2712ec69769f8c9aab3611b..588b3f01a7bceb7a1545d67aec1a767c87e7286f 100644 (file)
@@ -28,7 +28,7 @@
      <td><a href="{% url 'teleforma-profile-detail' user.username %}">{{ user.last_name }}</a></td>
      <td><a href="{% url 'teleforma-profile-detail' user.username %}">{{ user.first_name }}</a></td>
      <td><a href="{% url 'teleforma-profile-detail' user.username %}">{{ user.email }}</a></td>
-     <td><a href="{% url 'postman_write' user.username %}" class="component_icon button" id="action_orange">{% trans "Message" %}</a></td>
+     <td><a href="{% url 'postman:write' user.username %}" class="component_icon button" id="action_orange">{% trans "Message" %}</a></td>
     </tr>
     {% endfor %}
     </tbody>
index 9f86c295981626f267a9d3258e2939fe6cd15ca3..f410b4d557c51082bc1bd209465706ae779bc76b 100644 (file)
@@ -30,7 +30,7 @@
 
   {% if user.is_authenticated and user.username != usr.username %}
    <div class="module_action">
-    <a href="{% url 'postman_write' usr.username %}" class="component_icon button" id="action_orange">{% trans "Send a message" %}</a>
+    <a href="{% url 'postman:write' usr.username %}" class="component_icon button" id="action_orange">{% trans "Send a message" %}</a>
    </div>
   {%  endif %}
  </div>
index 44ff20bb29acfc680958510ecd743b22a46c19ca..78ac0a0784d2341a2b04c3c0ab2d5535683ac833 100644 (file)
@@ -117,7 +117,7 @@ class UsersView(ListView):
     #paginate_by = 12
 
     def get_queryset(self):
-        return User.objects.all().select_related(depth=1).order_by('last_name')
+        return User.objects.all().select_related().order_by('last_name')
 
     def get_context_data(self, **kwargs):
         context = super(UsersView, self).get_context_data(**kwargs)
index a3609a993e88980a54fe790bf2a4da6443d844d0..dc8aec7bb0e17790cf083933bf50d6d1d324f8a2 100644 (file)
@@ -17,7 +17,7 @@ class PageTextContent(object):
             yield line.rstrip('\r\n')
         file.close()
 
-    def __unicode__(self):
+    def __str__(self):
         file = open(self.filename, 'r')
         data = file.read()
         file.close()