<commit_before># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# MIT License. See license.txt

from __future__ import unicode_literals
import webnotes

class DocType():
	def __init__(self, doc, doclist=[]):
		self.doc = doc
		self.doclist = doclist
	
	def get_parent_bean(self):
		if self.doc.doctype:
			return webnotes.bean(self.doc.parenttype, self.doc.parent)
			
	def on_update(self):
		"""update status of parent Lead or Contact based on who is replying"""
		if self.doc.parenttype=="Support Ticket"
			# do nothing - handled by support ticket
			return
			
		parent = self.get_parent_bean()
		
		if parent:
			if webnotes.conn.get_value("Profile", self.doc.sender, "user_type")=="System User":
				parent.doc.status = "Replied"
			else:
				parent.doc.status = "Open"
		
			
			parent.ignore_permissions = True
			parent.ignore_mandatory = True
			parent.save()
<commit_msg>[communication] [minor]<commit_after># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# MIT License. See license.txt

from __future__ import unicode_literals
import webnotes

class DocType():
	def __init__(self, doc, doclist=[]):
		self.doc = doc
		self.doclist = doclist
	
	def get_parent_bean(self):
		if self.doc.doctype:
			return webnotes.bean(self.doc.parenttype, self.doc.parent)
			
	def on_update(self):
		"""update status of parent Lead or Contact based on who is replying"""
		if self.doc.parenttype=="Support Ticket":
			# do nothing - handled by support ticket
			return
			
		parent = self.get_parent_bean()
		
		if parent:
			if webnotes.conn.get_value("Profile", self.doc.sender, "user_type")=="System User":
				parent.doc.status = "Replied"
			else:
				parent.doc.status = "Open"
		
			
			parent.ignore_permissions = True
			parent.ignore_mandatory = True
			parent.save()

{'fraction_non_alphanumeric': 0.11247901510912144, 'fraction_numerical': 0.004476776720761052, 'mean_word_length': 3.7301587301587302, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7547387', 'n_tokens_mistral': 681, 'n_tokens_neox': 575, 'n_words': 159}