Skip to content
Snippets Groups Projects
Commit eaf9b009 authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

use contractor and subproject field to fill User.team field

parent b4802607
No related branches found
No related tags found
No related merge requests found
......@@ -133,7 +133,6 @@ public static void main(String[] args) {
.uniqueResult();
if (user == null) {
user = new User(getUserInfos());
user.setTeam("CHUV");
session.save(user);
}
session.getTransaction().commit();
......
......@@ -90,6 +90,18 @@ public class User {
}
}
p = Pattern.compile("contractor=([\\w ]+)");
m = p.matcher(userInfo);
if (m.find()) {
this.team = m.group(1);
}
p = Pattern.compile("subprojects=([A-Za-z0-9\\[\\] ]+)");
m = p.matcher(userInfo);
if (m.find()) {
this.team += m.group(1);
}
if (this.picture == null || this.picture.isEmpty()) {
this.picture = "images/users/default_user.png";
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment