This commit is contained in:
wrmswindmill 2018-09-16 15:01:23 +08:00
parent aaec289d85
commit 8e5caa92db
2 changed files with 10 additions and 3 deletions

View File

@ -1213,6 +1213,10 @@ def get_url_mapping_project(url):
filename = url[index+1:-1]
path_origin = path
else:
para_index = url.rfind("?")
if para_index != -1:
url = url[:para_index]
index_special = url.rfind("#")
path_origin = url[index1:]
if index_special == -1:

View File

@ -179,12 +179,14 @@ class ProjectSourceView(View):
response = json.loads(response.text)
email = response['email']
exist_records = User.objects.filter(email=email).first()
print(email)
pass_word = "init_password"
if not exist_records:
print(exist_records)
user = User()
user.username = response['username']
while User.objects.filter(username=user.username).first():
user.username += str(random.randint(0,10))
pass_word = "init_password"
user.password = make_password(pass_word)
user.password_codepedia = user.password
user.educoder_userid = int(educoder_userid)
@ -206,10 +208,11 @@ class ProjectSourceView(View):
def get(self, request, name, path):
educoder_userid = request.GET.get("eid","")
print("educoder_userid:"+educoder_userid)
if educoder_userid!="":
self.login_educoder(educoder_userid,request)
project = Project.objects.filter(name=name).first()
name = name.split("?")[0]
path = path.split("?")[0]
project = Project.objects.filter(name=name).first()
project_tree = projectTreeObj.get_project_tree_by_projectid(project.id)
return render(request, 'projects/source.html', locals())