]> git.parisson.com Git - teleforma.git/commitdiff
Add author script in admin list
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 13 Feb 2015 00:39:23 +0000 (01:39 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 13 Feb 2015 00:39:23 +0000 (01:39 +0100)
Remove type from mountpoint (new default deefuzzer behavior)

teleforma/exam/admin.py
teleforma/models/core.py

index 64bbff832ec4bdcc948b59a889a9e6c161f3a2e9..a2b2373f530c01edb53e43cac7723e4e6d224fad 100644 (file)
@@ -27,8 +27,10 @@ class ScriptAdmin(admin.ModelAdmin):
     search_fields = ['author__username', 'author__last_name', 'corrector__username',
                     'corrector__last_name', 'course__title']
     readonly_fields = ('date_added','uuid','box_uuid','sha1','mime_type')
-    # exclude = ['options']
-    # inlines = [ScriptPageInline]
+    list_display = ('title', 'author_name')
+
+    def author_name(self, instance):
+        return instance.author.username
 
 
 admin.site.register(Script, ScriptAdmin)
index a99b7c72bfcc3846c5e35f8e30f6ce342f27858b..e1d6edbb19ca245492ea5d536850625e0e2a7c58 100644 (file)
@@ -210,7 +210,7 @@ class Professor(Model):
     department = ForeignKey('Department', related_name='professor',
                                  verbose_name=_('department'),
                                  blank=True, null=True, on_delete=models.SET_NULL)
-    
+
     def __unicode__(self):
         if self.user.first_name and self.user.last_name:
             return self.user.last_name + ' ' + self.user.first_name[0] + '.'
@@ -428,7 +428,7 @@ class LiveStream(Model):
         if self.server.type == 'stream-m':
             return  'consume/' + self.slug
         else:
-            return self.slug + '.' + self.stream_type
+            return self.slug
 
     @property
     def snapshot_url(self):