Guillaume Englert  committed 9e9b1cc

refs #26 Remove a useless dependency to 'emails' + fix a crash when 'emails' is not present.

Comments (0)

Files changed (4)

File creme/crudity/backends/models.py Modified

View file
  • Ignore whitespace
  • Hide word diff
     limit_froms  = ()   #If "recipient" doesn't the backend policy
     subject      = u""  #Matched subject
     blocks       = ()   #Blocks classes
-    buttons      = None #An (mutable) iterable of buttons
+    #buttons      = None #An (mutable) iterable of buttons
 
     def __init__(self, config, *args, **kwargs):
         config_get = config.get
         self._sandbox_by_user = None
         self._check_configuration()
 #        self.body_map.update({'password': self.password})
+        self.buttons = []
 
     @property
     def is_configured(self):
         return is_created, instance
 
     def add_buttons(self, *buttons):
-        if self.buttons is None:
-            self.buttons = []
+        #if self.buttons is None:
+            #self.buttons = []
         self.buttons.extend(buttons)
 
     def get_rendered_buttons(self):

File creme/crudity/blocks.py Modified

View file
  • Ignore whitespace
  • Hide word diff
 
 from creme.creme_config.models import SettingValue
 
-from creme.emails.models import EntityEmail
+#from creme.emails.models import EntityEmail
 
 from .backends.models import CrudityBackend
 from .constants import SETTING_CRUDITY_SANDBOX_BY_USER
 
 
 class CrudityQuerysetBlock(QuerysetBlock):
-    def __init__(self, *args, **kwargs): #TODO: useless
+    def __init__(self, *args, **kwargs):
         super(CrudityQuerysetBlock, self).__init__()
 
     def detailview_display(self, context):
 
 
 class WaitingActionBlock(CrudityQuerysetBlock):
-    dependencies  = () #TODO: useless
+    #dependencies  = ()
     verbose_name  = _(u'Waiting actions')
     template_name = 'crudity/templatetags/block_waiting_action.html'
 
         return self._render(self.get_block_template_context(context,
                                                             waiting_actions,
                                                             waiting_ct=ct,
-                                                            email_ct=ContentType.objects.get_for_model(EntityEmail),#TODO: For now email, but generify this!
+                                                            #email_ct=ContentType.objects.get_for_model(EntityEmail),#todo: For now email, but generify this!
                                                             buttons=self.buttons,
                                                             backend=backend,
                                                             update_url='/crudity/waiting_actions_blocks/%s/reload' % (self.id_,),
 
 
 class HistoryBlock(CrudityQuerysetBlock):
-    dependencies  = ()
+    #dependencies  = ()
     verbose_name  = _(u'History')
     template_name = 'crudity/templatetags/block_history.html'
 
                                                             histories,
                                                             ct=ct,
                                                             buttons=self.buttons,
-                                                            email_ct=ContentType.objects.get_for_model(EntityEmail),
+                                                            #email_ct=ContentType.objects.get_for_model(EntityEmail),
                                                             update_url='/crudity/history_block/%s/reload' % (self.id_,),
                                                            ))
 

File creme/crudity/templates/crudity/templatetags/block_history.html Modified

View file
  • Ignore whitespace
  • Hide word diff
 <style type="text/css">
     {% comment %}Generify this{% endcomment %}
     .type_header_block {
-        background: url({% get_image_path_for_ctype email_ct 'normal' %}) no-repeat;
+        {% comment %}background: url({% get_image_path_for_ctype email_ct 'normal' %}) no-repeat;{% endcomment %}
+        background: url({% creme_media_url 'images/email_48.png' %}) no-repeat;
         width: 48px;
         height:48px;
     }

File creme/crudity/templates/crudity/templatetags/block_waiting_action.html Modified

View file
  • Ignore whitespace
  • Hide word diff
     <style type="text/css">
         {% comment %}Generify this{% endcomment %}
         .type_header_block {
-            background: url({% get_image_path_for_ctype email_ct 'normal' %}) no-repeat;
+            {% comment %}background: url({% get_image_path_for_ctype email_ct 'normal' %}) no-repeat;{% endcomment %}
+            background: url({% creme_media_url 'images/email_48.png' %}) no-repeat;
             width: 48px;
             height: 48px;
         }