Skip to content

Commit

Permalink
Merge pull request #72 from EBI-Metagenomics/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
atarkowska authored Sep 14, 2018
2 parents 2b61e6a + 8e4b89a commit bb047e2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
19 changes: 16 additions & 3 deletions emgcli/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,34 @@
'filters': ['require_debug_true'],
'formatter': 'default',
},
'notify': {
'level': 'DEBUG',
'class': LOGGING_CLASS,
'filename': os.path.join(LOGDIR, 'notify.log').replace('\\', '/'),
'maxBytes': 1024*1024*10,
'backupCount': 50,
'formatter': 'default',
},
},
'loggers': {
'emgena': {
'handlers': ['notify'],
'level': 'INFO',
'propagate': False
},
'django.request': { # Stop SQL debug from logging to main logger
'handlers': ['default'],
'level': 'DEBUG',
'level': 'INFO',
'propagate': False
},
'django': {
'handlers': ['null'],
'level': 'DEBUG',
'level': 'INFO',
'propagate': True
},
'': {
'handlers': ['default'],
'level': 'DEBUG',
'level': 'INFO',
'propagate': True
}
}
Expand Down
8 changes: 5 additions & 3 deletions emgena/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class EmailSerializer(serializers.Serializer):

def create(self, validated_data):
validated_data['recipient_list'] = (settings.EMAIL_HELPDESK,)
logger.info("Email %r" % validated_data)
send_mail(**validated_data)

class Meta:
Expand All @@ -59,8 +60,8 @@ class Meta:
class NotifySerializer(serializers.Serializer):

from_email = serializers.EmailField(max_length=200, required=True)
subject = serializers.CharField(max_length=100, required=True)
message = serializers.CharField(max_length=500, required=True)
subject = serializers.CharField(max_length=500, required=True)
message = serializers.CharField(max_length=1000, required=True)

def create(self, validated_data):
import requests
Expand All @@ -72,8 +73,9 @@ def create(self, validated_data):
"Requestor": n.from_email,
"Priority": "4",
"Subject": n.subject,
"Text": n.message
"Text": n.message.replace("\n", ';')
}
logger.info("Ticket %r" % ticket)

content = [
"{key}: {value}".format(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
_requirements = os.path.join(_base, 'requirements.txt')
_requirements_test = os.path.join(_base, 'requirements-test.txt')

version = "1.3.5"
version = "1.3.6"

install_requirements = []
with open(_requirements) as f:
Expand Down

0 comments on commit bb047e2

Please sign in to comment.